This repository was archived by the owner on Dec 26, 2025. It is now read-only.
feat(accessibility): add support for escape key handling#601
Open
tavanuka wants to merge 3 commits intoBlazored:mainfrom
Open
feat(accessibility): add support for escape key handling#601tavanuka wants to merge 3 commits intoBlazored:mainfrom
tavanuka wants to merge 3 commits intoBlazored:mainfrom
Conversation
Author
|
Workflow action requires approval to be executed. |
|
Clear and simple solution, that aligns perfectly with existing code. Its a thumbs up from me, ill unsubscribe the #512 in hopes that this will be merged in. |
Author
|
@NeskireDK Thank you. Code has been internally tested by my colleague and vibe checked in case I have done any hiccups. According to him: "LGTM" |
Author
|
I will add a documentation entry describing this feature. I forgot about this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Resolves #512.
This PR aims to add escape key handling support for modal instances by having a global handler which programmatically closes last-most instance when the escape key is pressed.
Instead of registering a handler per instance, a global handler is registered once via JavaScript and bypasses using event handlers.
Although I am not the biggest fan of JS, I see no other way for this use-case to be solved. This solution should also mitigate any weird and inconsistent behaviours that occurred with the previous fix caused by #201 and #202.
Additionally, support for disabling escape key handling can be set globally, or per-instance.
I have extended the unit tests to ensure coverage of the newly added feature.
@chrissainty If possible, a review and potential merge would be optimal - as we use this dependency in the customer's project extensively and its requirement is better accessibility. I was assigned to implement this feature, with additional colleague tasked to do a review of my changes - as they do not wish to resort to having to compile a fork.