-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
feat: overlays, enter key to dismiss dialog with inputs #21665
Comments
I hope this feature can be seen in V6 versions. @liamdebeasi |
Hi everyone, The team is reviewing feature requests in our backlog. Is anyone able to clarify why they would like to dismiss overlays with the "Enter" key? A code example of the problem you are running into would also be helpful. |
It looks like this is now working for alerts that do not include const alert = await alertController.create({
header,
message,
buttons: [
{
text: 'Cancel',
role: 'cancel',
},
{
text: 'OK',
},
],
});
alert.present(); This works and the user is able to use the Enter and Escape keys to confirm or cancel the alert. If you include inputs: const alert = await alertController.create({
header,
message,
inputs: [
{
type: 'text',
name: 'value',
value,
},
],
buttons: [
{
text: 'Cancel',
role: 'cancel',
},
{
text: 'OK',
},
],
});
alert.present(); Then the Enter key does not close the alert. This is different from The general use case is for users who are working on a desktop browser and want to work from the keyboard without going back and forth to the mouse when entering information. This is also the case for things like being able to set focus when a dialog is displayed. |
For accessibility reasons, an alert should be closed if there are no interactive elements (e.g., "close", "save", etc.) with the An overlay (totally separate entity from an alert dialog) should be dismissable with either clicking off with the mouse or by initiating a trigger (an "x" for instance) in the overlay and then using the |
Feature Request
Ionic version:
[x] 5.2.3
Describe the Feature Request
When running in a desktop browser, it is common to be able to use the Enter and Escape keys to dismiss alert dialogs.
For example, "Are you sure you want to..." with OK and Cancel buttons.
Describe Preferred Solution
Add a way to indicate this behavior when specifying the buttons to be displayed.
Possible approaches:
role
value to indicate the accept button (similar to current cancel behavior)The text was updated successfully, but these errors were encountered: