Skip to content
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

Modal: Enter key closes dialog unexpectedly #5728

Closed
anhallbe opened this issue Oct 11, 2021 · 4 comments · Fixed by #5848
Closed

Modal: Enter key closes dialog unexpectedly #5728

anhallbe opened this issue Oct 11, 2021 · 4 comments · Fixed by #5848
Assignees
Labels
team: homepages Issues for the homepages team type: bug 🐛 [2] Velocity rating (Fibonacci)

Comments

@anhallbe
Copy link

anhallbe commented Oct 11, 2021

Describe the bug
When in a dialog, pressing the "Enter" key when focusing a field that doesn't handle the event (keydown enter) will cause the dialog to be closed.

I'm not sure if this is a bug or feature, but it's a new (undocumented?) behavior since 4.54.0.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'https://design.infor.com/code/ids-enterprise/4.54.0/demo/components/modal/example-index' or any later versions
  2. Click on 'Show Modal', optionally write something in the first input field
  3. Press Enter
  4. The dialog closes

Expected behavior
When repeating the above, but on 4.53.5 the dialog is not closed.

Version

  • ids-enterprise: 4,54,0 to current latest

Platform

  • Browser Name: Chrome

Additional context
Causing some issues in multiple projects and dialogs, especially where "Enter" is handled in an unexpected way, for example an Autocomplete field where no value has been selected:

https://jira.infor.com/browse/LIME-7118
https://jira.infor.com/browse/MINGLEDEV-32468

@anhallbe anhallbe changed the title Modal: Enter closes dialog unexpectedly Modal: Enter key closes dialog unexpectedly Oct 11, 2021
@tmcconechy
Copy link
Member

Yes it was be design. It was not working so we fixed it. See #5198

We could make it an option though? But this is like normal alert dialogs where it triggers the primary

@tmcconechy tmcconechy added [2] Velocity rating (Fibonacci) type: bug 🐛 labels Oct 11, 2021
@anhallbe
Copy link
Author

Okay thanks for the info @tmcconechy !

I guess it makes sense as a default. I think our issue is mainly that in some cases the "enter keypress" event bubbles up to the dialog unexpectedly (e.g an Autocomplete where no value is selected). But that's a separate issue.

Although I also guess it could be nice to be able to disable it, since it might be annoying when there's a modal with many fields, some of which requires "enter" to fill them out (textarea, dropdowns etc), while others will accidentally close the dialog.

@tmcconechy
Copy link
Member

Sure, if enter in textarea and dropdown closes it that would be a bug.. But we made exceptions for these https://main-enterprise.demo.design.infor.com/components/modal/example-index.html

Yes, i think we could just make this an option

@nganotice
Copy link

This has been QA tested and passed on v4.58.0-dev.

https://main-enterprise.demo.design.infor.com/components/modal/example-index.html

Moving this ticket to Done.

Thanks!

@nganotice nganotice moved this from Ready for QA (beta) to Done in Enterprise 4.58.x (Nov 2021) Sprint Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: homepages Issues for the homepages team type: bug 🐛 [2] Velocity rating (Fibonacci)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants