@khanacademy/perseus 22.0.1 → 22.0.2

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/dist/index.js CHANGED
@@ -649,6 +649,9 @@ class InnerMathInput extends React__namespace.Component {
649
649
  class MathInput extends React__namespace.Component {
650
650
  static contextType = mathInput.MathInputI18nContext;
651
651
  inputRef = /*#__PURE__*/React__namespace.createRef();
652
+ blur() {
653
+ this.inputRef.current?.blur();
654
+ }
652
655
  focus() {
653
656
  this.inputRef.current?.focus();
654
657
  }
@@ -2594,7 +2597,11 @@ class Expression extends React__namespace.Component {
2594
2597
  blurInputPath = inputPath => {
2595
2598
  // eslint-disable-next-line react/no-string-refs
2596
2599
  // @ts-expect-error - TS2339 - Property 'blur' does not exist on type 'ReactInstance'.
2597
- this.refs.input?.blur();
2600
+ if (typeof this.refs.input?.blur === "function") {
2601
+ // eslint-disable-next-line react/no-string-refs
2602
+ // @ts-expect-error - TS2339 - Property 'blur' does not exist on type 'ReactInstance'.
2603
+ this.refs.input?.blur();
2604
+ }
2598
2605
  };
2599
2606
 
2600
2607
  // HACK(joel)
@@ -21944,10 +21951,14 @@ class SimpleKeypadInput extends React__namespace.Component {
21944
21951
  }
21945
21952
 
21946
21953
  blur() {
21954
+ // eslint-disable-next-line react/no-string-refs
21947
21955
  // @ts-expect-error - TS2339 - Property 'blur' does not exist on type 'ReactInstance'.
21948
- this.refs.input?.blur(); // eslint-disable-line react/no-string-refs
21956
+ if (typeof this.refs.input?.blur === "function") {
21957
+ // eslint-disable-next-line react/no-string-refs
21958
+ // @ts-expect-error - TS2339 - Property 'blur' does not exist on type 'ReactInstance'.
21959
+ this.refs.input?.blur();
21960
+ }
21949
21961
  }
21950
-
21951
21962
  getValue() {
21952
21963
  return this.props.value;
21953
21964
  }
@@ -22152,7 +22163,11 @@ class InputNumber extends React__namespace.Component {
22152
22163
  blurInputPath = inputPath => {
22153
22164
  // eslint-disable-next-line react/no-string-refs
22154
22165
  // @ts-expect-error - TS2339 - Property 'blur' does not exist on type 'ReactInstance'.
22155
- this.refs.input?.blur();
22166
+ if (typeof this.refs.input?.blur === "function") {
22167
+ // eslint-disable-next-line react/no-string-refs
22168
+ // @ts-expect-error - TS2339 - Property 'blur' does not exist on type 'ReactInstance'.
22169
+ this.refs.input?.blur();
22170
+ }
22156
22171
  };
22157
22172
  getInputPaths = () => {
22158
22173
  // The widget itself is an input, so we return a single empty list to
@@ -43336,7 +43351,7 @@ const init = function (options) {
43336
43351
 
43337
43352
  // This file is processed by a Rollup plugin (replace) to inject the production
43338
43353
  const libName = "@khanacademy/perseus";
43339
- const libVersion = "22.0.1";
43354
+ const libVersion = "22.0.2";
43340
43355
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
43341
43356
 
43342
43357
  const apiVersion = {