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

BUG: If Enter clicked on dialog, it does not behave as expected #875

Closed
hsekowski-splunk opened this issue Nov 3, 2021 · 2 comments · Fixed by #1047
Closed

BUG: If Enter clicked on dialog, it does not behave as expected #875

hsekowski-splunk opened this issue Nov 3, 2021 · 2 comments · Fixed by #1047
Assignees
Labels
bug Something isn't working

Comments

@hsekowski-splunk
Copy link
Contributor

hsekowski-splunk commented Nov 3, 2021

Once you press enter on some dialog, the dialog is closed with action as on "Cancel" while action like on "Add" would be expected.
image (7)

@tbalar-splunk tbalar-splunk self-assigned this Feb 21, 2023
@artemrys artemrys transferred this issue from splunk/addonfactory-ucc-base-ui Oct 4, 2023
@artemrys artemrys changed the title If Enter clicked on dialog, it does not behave as expected BUG: If Enter clicked on dialog, it does not behave as expected Oct 10, 2023
@artemrys artemrys added bug Something isn't working needs investigation Issues that need investigation labels Oct 10, 2023
@artemrys artemrys self-assigned this Jan 25, 2024
@artemrys
Copy link
Member

I still can reproduce the issue using one of the latest UCC versions.

@vtsvetkov-splunk @soleksy-splunk we should do something about it, my proposal is to remove the interaction at all. I believe Splunk itself does not support "Enter".

@artemrys artemrys removed their assignment Jan 25, 2024
@vtsvetkov-splunk
Copy link
Contributor

https://splunk.slack.com/archives/C018BQV4264/p1706715061243149?thread_ts=1706698692.774949&cid=C018BQV4264
Let's fix it. Enter key should not cancel nor submit until the submit button is focused.

@vtsvetkov-splunk vtsvetkov-splunk removed the needs investigation Issues that need investigation label Feb 1, 2024
artemrys pushed a commit that referenced this issue Feb 6, 2024
…dow (#1047)

## The problem

Enter for a form with single input triggers the form submission. [The
specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission).
The form submission was not properly handled.

## The fix
- hook up on form submission by adding callback onSubmit for `<form />`
element
- prevent default behavior (sending GET with formdata in params and
redirect) and proceed with our handlers (validation and sending as JSON
with AJAX)

## References
- https://splunk.atlassian.net/browse/ADDON-61126
- https://splunk.atlassian.net/browse/ADDON-58706

Resolves #875
This was referenced Feb 6, 2024
srv-rr-github-token added a commit that referenced this issue Feb 6, 2024
# [5.38.0](v5.37.0...v5.38.0) (2024-02-06)

### Bug Fixes

* **EntityModal:** prevent Enter from submitting the form in Modal window ([#1047](#1047)) ([b7f179a](b7f179a)), closes [#875](#875)
* OpenAPI schema generator fixes for when multiple inputs are defined ([#1016](#1016)) ([332db43](332db43))

### Features

* add UCC version to globalConfig ([#984](#984)) ([e1229b4](e1229b4))
* ADDON-67533 implement support for oauth autorize and token urls ([#1009](#1009)) ([aada373](aada373))
* allow wildcards in .uccignore file ([#1012](#1012)) ([04b847f](04b847f)), closes [#1011](#1011)
* change avg() to sum() in PANEL_EVENTS_INGESTED_BY_SOURCETYPE_TEMPLATE panel ([#1028](#1028)) ([c738634](c738634))
* customizing version of pip in build, add legacy resolver as optional ([#1035](#1035)) ([751990c](751990c))
* default warning hidden after any input ([#1024](#1024)) ([d0d69ee](d0d69ee))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants