FocusOverlay icon indicating copy to clipboard operation
FocusOverlay copied to clipboard

fix data-focus target assignment

Open rhahne opened this issue 5 years ago • 0 comments

Fixing the data-focus atribute Currently the data-focus attribute does not work as described in your documentation. The method, which assigns the corresponding target in the data-focus attribute is not correct. Therefore I fixed it in this PR.

Adding currentTarget var Currently if an event gets provided to the moveFocusBox function the fallback was document.activeElement. This does not respect the ability of applying the focusBox to another element than the one which is currently active. Therefore I added the currentTarget variable which gets assigned after the data-focus / data-focus-label / data-focus-ignore exceptions in the onFocusHandler function. The variable will then be used in the moveFocusBox as a new fallback.

This will ensure that always the correct element will be focused when the moveFocusBox function is being called.

rhahne avatar Dec 18 '20 14:12 rhahne