-
Notifications
You must be signed in to change notification settings - Fork 76
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(input-date-picker, input-time-picker, modal, sheet): closes on escape when focusTrap is disabled #10578
fix(input-date-picker, input-time-picker, modal, sheet): closes on escape when focusTrap is disabled #10578
Conversation
// | ||
//-------------------------------------------------------------------------- | ||
|
||
@Listen("keydown", { target: "window" }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of creating this event on the window, can we add it on the host of the component? That way, it won't close for an escape that happens outside of the component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing with the modal component. Although less important since the modal is deprecated :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I initially had it on host but @jcfranco thinks we should close the modal/sheet regardless of where esc occurs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a sheet can be non modal, we wouldn't want escape closing it from outside of the sheet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
As per group discussion. @geospatialem @jcfranco @SkyeSeitz @ashetland @driskull
|
I think for the future we should plan to deprecate |
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, @Elijbet! Once comments are addressed, this is good to go! ✨🚀✨
packages/calcite-components/src/components/input-date-picker/input-date-picker.e2e.ts
Outdated
Show resolved
Hide resolved
packages/calcite-components/src/components/input-date-picker/input-date-picker.e2e.ts
Outdated
Show resolved
Hide resolved
Note: With this change it will only be closing on Escape when focus trap is disabled if the event is emitted within the component (i.e., Escape won't close if focus is in another, separate, element). |
Related Issue: #10522
Summary
Close on
Escape
works whenfocusTrap
is disabled.