Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What issue does this PR close
Closes #618
Changes Proposed ( a list of new changes introduced by this PR)
keyListener
custom element. It's useful to listen for keys without the need for a subscription. It's very extensible, allowing us to listen to any event, such askeydown
,keypress
andkeyup
. It also allows for multiple (typed) keys to be listened to, and tostopPropagation
. We use this element to listen forEscape
on modals.focusTrap
custom element. It acts like adiv
, but won't let focus get outside of it. We should be careful when using it thoughHow to test ( a list of instructions on how to test this PR)
Testing modals:
Tab
a bunch of times. That should cycle the focus within the modal, but shouldn't focus elements outside of the modal. Do the same withShift+Tab
(to go in the opposite direction)Esc
on your keyboard, clicking outside of it and by clicking on the "X" button on the topTesting the contact flag selection:
Tab
and notice how the select is only focused once. If you enter the select, you should see that pressing the up key or down key cycles through the options