diff --git a/.changeset/itchy-doors-greet.md b/.changeset/itchy-doors-greet.md new file mode 100644 index 0000000000..1093f34813 --- /dev/null +++ b/.changeset/itchy-doors-greet.md @@ -0,0 +1,5 @@ +--- +"@khanacademy/math-input": patch +--- + +Ensured that the keypad is hidden from screen readers when it is closed. diff --git a/packages/math-input/src/components/keypad/mobile-keypad.tsx b/packages/math-input/src/components/keypad/mobile-keypad.tsx index 26d750e980..d6332312ec 100644 --- a/packages/math-input/src/components/keypad/mobile-keypad.tsx +++ b/packages/math-input/src/components/keypad/mobile-keypad.tsx @@ -155,7 +155,7 @@ class MobileKeypad extends React.Component implements KeypadAPI { const containerStyle = [ // internal styles styles.keypadContainer, - active ? styles.activeKeypadContainer : null, + active && styles.activeKeypadContainer, // styles passed as props ...(Array.isArray(style) ? style : [style]), ]; @@ -217,13 +217,14 @@ const styles = StyleSheet.create({ left: 0, right: 0, position: "fixed", + transitionProperty: "all", transition: `200ms ease-out`, - transitionProperty: "transform", + visibility: "hidden", transform: "translate3d(0, 100%, 0)", }, - activeKeypadContainer: { transform: "translate3d(0, 0, 0)", + visibility: "visible", }, });