Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix: refactor some focus logic in MenuButton and SplitButton #2145

Merged
merged 5 commits into from
Dec 5, 2019

Conversation

silviuaavram
Copy link
Collaborator

@silviuaavram silviuaavram commented Dec 4, 2019

MenuButton: single point of changing the open state prop, and calling onOpenChange from that place.

SplitButton: refactored the behavior. (Shift)Tab handlers are not needed, handled by menuButtonBehavior. Replaced the open call from Popup with openAndFocusFrist from MenuButton, in the behavior, on Alt+Arrow Down.

Popup: on update/mount will check if prop open is passed (controlled mode) and then update the trigger reference. Fixes on MenuButton the trigger focus on close when it was opened only by Arrow Down.

@silviuaavram silviuaavram changed the title fix: refactor some focus login in MenuButton and SplitButton fix: refactor some focus logic in MenuButton and SplitButton Dec 4, 2019
Copy link
Collaborator

@kolaps33 kolaps33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested with JAWS virtual cursor and NVDA browse mode and can confirm original issue is fixed :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants