microsoft / tabster

Web Application Keyboard Navigation Tools
https://tabster.io
MIT License
118 stars 36 forks source link

fix: Restorer works in Firefox and Safari when initial focus is set #343

Closed smhigley closed 7 months ago

smhigley commented 8 months ago

Related to #306 Fixes ADO bug

The initial solution works when the focusin event is fired within the target container element, but fails when it is removed after being opened but without moving focus (e.g. open a dialog, then immediately close it).

This fixes that bug by setting this._hasFocus when the restorer instance is created.

I also updated the restorer stories so that focus moves to the created restorer container to more accurately simulate a popup.