Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix data-focus target assignment #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix data-focus target assignment #3

wants to merge 1 commit into from

Conversation

rhahne
Copy link

@rhahne rhahne commented Dec 18, 2020

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.

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