Skip to content

fix: getLastFocusedProgrammatically returns the element even after the focusin event is processed#49

Open
behowell wants to merge 2 commits into
microsoft:mainfrom
behowell:fix-getLastFocusedProgrammatically
Open

fix: getLastFocusedProgrammatically returns the element even after the focusin event is processed#49
behowell wants to merge 2 commits into
microsoft:mainfrom
behowell:fix-getLastFocusedProgrammatically

Conversation

@behowell

Copy link
Copy Markdown

Previous Behavior

Keyborg saves the lastFocusedProgrammatically element when element.focus() is called, and then clears it when the focusin event happens. The result is that the value is cleared before a React app gets the focus event, so there's no reasonable way for the app to call getLastFocusedProgrammatically when it has a valid value.

New Behavior

Only clear the lastFocusedProgrammatically value the next time focus changes without element.focus() being called. This leaves the value set between focus moves, and keeps its value useful to React apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant