diff --git a/.changeset/dry-shirts-refuse.md b/.changeset/dry-shirts-refuse.md new file mode 100644 index 0000000000..7605007bef --- /dev/null +++ b/.changeset/dry-shirts-refuse.md @@ -0,0 +1,6 @@ +--- +"@khanacademy/math-input": patch +"@khanacademy/perseus": patch +--- + +Fix expression widget styling issues. Close button focus outline is now visible, backspace button styling is now consistent with other buttons, and adjusted the popover padding. diff --git a/packages/math-input/src/components/keypad/__tests__/__snapshots__/keypad.test.tsx.snap b/packages/math-input/src/components/keypad/__tests__/__snapshots__/keypad.test.tsx.snap index e149a9ebdc..142e52d663 100644 --- a/packages/math-input/src/components/keypad/__tests__/__snapshots__/keypad.test.tsx.snap +++ b/packages/math-input/src/components/keypad/__tests__/__snapshots__/keypad.test.tsx.snap @@ -835,7 +835,7 @@ exports[`keypad should snapshot expanded: first render 1`] = ` class="default_xu2jcg-o_O-outerBoxBase_3w5jmh" >
diff --git a/packages/math-input/src/components/keypad/shared-keys.tsx b/packages/math-input/src/components/keypad/shared-keys.tsx index 18308ef4ae..e256987d09 100644 --- a/packages/math-input/src/components/keypad/shared-keys.tsx +++ b/packages/math-input/src/components/keypad/shared-keys.tsx @@ -103,7 +103,7 @@ export default function SharedKeys(props: Props) { keyConfig={Keys.BACKSPACE} onClickKey={onClickKey} coord={[5, 3]} - action + secondary /> ); diff --git a/packages/perseus/src/components/math-input.tsx b/packages/perseus/src/components/math-input.tsx index 690e1deec9..9bb34a1c36 100644 --- a/packages/perseus/src/components/math-input.tsx +++ b/packages/perseus/src/components/math-input.tsx @@ -282,9 +282,13 @@ class InnerMathInput extends React.Component { // a keyboard event is "keydown" type. // In react without WonderBlocks, "enter" or "space" keydown events // are also "click" events, differentiated by "detail". - if (e.type === "click") { + if (e?.type === "click") { this.focus(); } + + if (key === "DISMISS") { + this.closeKeypad(); + } }; render(): React.ReactNode { @@ -340,10 +344,9 @@ class InnerMathInput extends React.Component { onBlur={() => this.blur()} /> this.closeKeypad()} dismissEnabled + rootBoundary="document" aria-label={this.context.strings.mathInputTitle} aria-describedby={`popover-content-${popoverContentUniqueId}`} content={() => ( @@ -355,7 +358,6 @@ class InnerMathInput extends React.Component { {this.context.strings.mathInputDescription} { mapButtonSets( this.props?.buttonSets, ))} + showDismiss /> @@ -554,7 +557,6 @@ const styles = StyleSheet.create({ }, popoverContent: { padding: 0, - paddingBottom: spacing.xxSmall_6, maxWidth: "initial", }, });