@khanacademy/math-input 12.0.1 → 12.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/components/input/math-input.d.ts +1 -1
- package/dist/es/index.js +16 -27
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +16 -27
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/input/math-input.tsx +5 -13
- package/src/components/keypad/mobile-keypad.tsx +4 -8
- package/src/full-math-input.stories.tsx +1 -7
- package/tsconfig-build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @khanacademy/math-input
|
|
2
2
|
|
|
3
|
+
## 12.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [4f4fe4f9]
|
|
8
|
+
- @khanacademy/perseus-core@1.1.0
|
|
9
|
+
|
|
10
|
+
## 12.1.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- a5a60852: revert focus changes to math input
|
|
15
|
+
|
|
3
16
|
## 12.0.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -50,7 +50,7 @@ declare class MathInput extends React.Component<Props, State> {
|
|
|
50
50
|
_updateCursorHandle: (arg1?: boolean) => void;
|
|
51
51
|
_hideCursorHandle: () => void;
|
|
52
52
|
_handleScroll: () => void;
|
|
53
|
-
blur: (
|
|
53
|
+
blur: () => void;
|
|
54
54
|
focus: () => void;
|
|
55
55
|
/**
|
|
56
56
|
* Tries to determine which DOM node to place the cursor next to based on
|
package/dist/es/index.js
CHANGED
|
@@ -1553,11 +1553,9 @@ class MathInput extends React.Component {
|
|
|
1553
1553
|
this._hideCursorHandle();
|
|
1554
1554
|
}
|
|
1555
1555
|
};
|
|
1556
|
-
this.blur =
|
|
1556
|
+
this.blur = () => {
|
|
1557
1557
|
this.mathField.blur();
|
|
1558
|
-
|
|
1559
|
-
this.props.onBlur && this.props.onBlur();
|
|
1560
|
-
}
|
|
1558
|
+
this.props.onBlur && this.props.onBlur();
|
|
1561
1559
|
this.setState({
|
|
1562
1560
|
focused: false,
|
|
1563
1561
|
handle: {
|
|
@@ -2014,7 +2012,7 @@ class MathInput extends React.Component {
|
|
|
2014
2012
|
// dismissal. This code needs to be generalized to handle
|
|
2015
2013
|
// multi-touch.
|
|
2016
2014
|
if (this.state.focused && this.didTouchOutside && !this.didScroll) {
|
|
2017
|
-
this.blur(
|
|
2015
|
+
this.blur();
|
|
2018
2016
|
}
|
|
2019
2017
|
this.didTouchOutside = false;
|
|
2020
2018
|
this.didScroll = false;
|
|
@@ -2090,18 +2088,13 @@ class MathInput extends React.Component {
|
|
|
2090
2088
|
role: "textbox",
|
|
2091
2089
|
ariaLabel: ariaLabel
|
|
2092
2090
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2093
|
-
className: "keypad-input"
|
|
2094
|
-
|
|
2091
|
+
className: "keypad-input"
|
|
2092
|
+
// @ts-expect-error - TS2322 - Type 'string' is not assignable to type 'number | undefined'.
|
|
2093
|
+
,
|
|
2094
|
+
tabIndex: "0",
|
|
2095
2095
|
ref: node => {
|
|
2096
2096
|
this.inputRef = node;
|
|
2097
2097
|
},
|
|
2098
|
-
onFocus: () => {
|
|
2099
|
-
this.focus();
|
|
2100
|
-
},
|
|
2101
|
-
onBlur: () => {
|
|
2102
|
-
this._hideCursorHandle();
|
|
2103
|
-
this.blur(false);
|
|
2104
|
-
},
|
|
2105
2098
|
onKeyUp: this.handleKeyUp
|
|
2106
2099
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2107
2100
|
ref: node => {
|
|
@@ -5128,21 +5121,17 @@ class MobileKeypad extends React.Component {
|
|
|
5128
5121
|
}, 100);
|
|
5129
5122
|
};
|
|
5130
5123
|
this.activate = () => {
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
});
|
|
5135
|
-
}
|
|
5124
|
+
this.setState({
|
|
5125
|
+
active: true
|
|
5126
|
+
});
|
|
5136
5127
|
};
|
|
5137
5128
|
this.dismiss = () => {
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
});
|
|
5145
|
-
}
|
|
5129
|
+
this.setState({
|
|
5130
|
+
active: false
|
|
5131
|
+
}, () => {
|
|
5132
|
+
var _this$props$onDismiss, _this$props;
|
|
5133
|
+
(_this$props$onDismiss = (_this$props = this.props).onDismiss) == null ? void 0 : _this$props$onDismiss.call(_this$props);
|
|
5134
|
+
});
|
|
5146
5135
|
};
|
|
5147
5136
|
this.configure = (configuration, cb) => {
|
|
5148
5137
|
this.setState({
|