-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LEMS-2880] Bugfix the close button focus outline on hover in keypad and other style issues #2296
base: main
Are you sure you want to change the base?
Changes from all commits
79b1ff3
391629a
e16dfb8
49c2537
bd4dd02
2f7a21e
fc048e3
7546900
206df0a
3caf2c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -282,9 +282,13 @@ class InnerMathInput extends React.Component<InnerProps, State> { | |
// 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<InnerProps, State> { | |
onBlur={() => this.blur()} | ||
/> | ||
<Popover | ||
rootBoundary="document" | ||
opened={this.state.keypadOpen} | ||
onClose={() => this.closeKeypad()} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting why remove the onClose event? How was this effecting the style of the close button? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. onClose event was remove and used the showDismiss props of the keypad component. The onClose event is something that the Popover component handles which is the outer component which has a different position of the close button, but by leveraging the showDismiss props it will correctly align in the TabBar which the icons are position as part of the inner component. |
||
dismissEnabled | ||
rootBoundary="document" | ||
aria-label={this.context.strings.mathInputTitle} | ||
aria-describedby={`popover-content-${popoverContentUniqueId}`} | ||
content={() => ( | ||
|
@@ -355,7 +358,6 @@ class InnerMathInput extends React.Component<InnerProps, State> { | |
{this.context.strings.mathInputDescription} | ||
</HeadingMedium> | ||
<PopoverContentCore | ||
closeButtonVisible | ||
style={styles.popoverContent} | ||
> | ||
<DesktopKeypad | ||
|
@@ -372,6 +374,7 @@ class InnerMathInput extends React.Component<InnerProps, State> { | |
mapButtonSets( | ||
this.props?.buttonSets, | ||
))} | ||
showDismiss | ||
/> | ||
</PopoverContentCore> | ||
</> | ||
|
@@ -554,7 +557,6 @@ const styles = StyleSheet.create({ | |
}, | ||
popoverContent: { | ||
padding: 0, | ||
paddingBottom: spacing.xxSmall_6, | ||
maxWidth: "initial", | ||
}, | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this is in a Story... did you also test this fix in webapp? Just want to make sure we aren't fixing this style issue for a story only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good call! I'll do that. Base on code search we might also need to update the webapp side. Let me get back to you on this after i'm fully setup with the webapp and have a separate PR for it.