Deloser currently works automatically. It tracks focus history inside and restores focus if it is lost.
From the ability to control that behaviour programmatically we have tabster:movefocus custom event. The subscribers of this event can call preventDefault() whenever Deloser wants to restore focus, to prevent the default behaviour. We also have tabster:deloser:focus-lost dispatched when Deloser registers lost focus. And we have tabster:deloser:restore-focus event which could be dispatched by the application to force Deloser to restore focus using focus history.
To complete the adjustability of the Deloser behaviour let's add inert property, so that it can just track history and the application would be deciding if it wants to restore focus or not. This is currently doable by creating tabster:movefocus custom event handler, but having a prop would be add extra convenience and declarativity of the API.
Within this task we also need to cover the Deloser programmatic control with a bunch of tests.
Deloser currently works automatically. It tracks focus history inside and restores focus if it is lost.
From the ability to control that behaviour programmatically we have
tabster:movefocus
custom event. The subscribers of this event can callpreventDefault()
whenever Deloser wants to restore focus, to prevent the default behaviour. We also havetabster:deloser:focus-lost
dispatched when Deloser registers lost focus. And we havetabster:deloser:restore-focus
event which could be dispatched by the application to force Deloser to restore focus using focus history.To complete the adjustability of the Deloser behaviour let's add
inert
property, so that it can just track history and the application would be deciding if it wants to restore focus or not. This is currently doable by creatingtabster:movefocus
custom event handler, but having a prop would be add extra convenience and declarativity of the API.Within this task we also need to cover the Deloser programmatic control with a bunch of tests.