Skip to content

Commit

Permalink
fix: preserve focus on skin tone button after close
Browse files Browse the repository at this point in the history
Once closing skin tone after choosing an option the focus got lost which is not a11y friendly.
  • Loading branch information
andrejkaPry committed May 31, 2024
1 parent d7fa4eb commit 68f0c68
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/emoji-mart/src/components/Picker/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,8 @@ export default class Picker extends Component {
if (!this.state.showSkins) return
this.setState({ showSkins: null, tempSkin: null })

this.refs.skinToneButton.current.focus()

this.base.removeEventListener('click', this.handleBaseClick)
this.base.removeEventListener('keydown', this.handleBaseKeydown)
}
Expand Down

0 comments on commit 68f0c68

Please sign in to comment.