feat: add events for backdrop click and detail Escape press #9062
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.



Description
Part of #9049
Added two events that can be used to determine if the detail content should be removed:
backdrop-click(only in the overlay mode)detail-esape-press(in all modes)Note: in the overlay mode some users might expect global Escape to work the same as in dialog, i.e. without the need to have detail area focused (which can happen if you click on the blank space below inputs in
detail-content).However, implementing that would be somewhat tricky as the global
keydownlistener could interfere withvaadin-overlay-escape-pressevent - so we would need to have some way to detect if Escape is being handled elsewhere. This would also require integration tests for all components that handle Escape internally, using it for clear button and closing overlay.So IMO it's easier to add explicit
keydownlistener on the detail part for now, and discuss the above case separately.Type of change