Skip to content

Commit

Permalink
Merge pull request #1530 from dhis2/fix/split-button-event
Browse files Browse the repository at this point in the history
fix(split-button): stop swallowing key down events
  • Loading branch information
kabaros authored Jun 20, 2024
2 parents 0bd4191 + 22d43bc commit 8054140
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/button/src/split-button/split-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class SplitButton extends Component {
document.removeEventListener('keydown', this.handleKeyDown)
}
handleKeyDown = (event) => {
event.preventDefault()
if (event.key === 'Escape' && this.state.open) {
event.preventDefault()
event.stopPropagation()
this.setState({ open: false })
this.anchorRef.current && this.anchorRef.current.focus()
Expand Down

0 comments on commit 8054140

Please sign in to comment.