Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

AJAX submit not firing when Enter pressed #107

Open
dan-garden opened this issue Mar 27, 2019 · 1 comment
Open

AJAX submit not firing when Enter pressed #107

dan-garden opened this issue Mar 27, 2019 · 1 comment

Comments

@dan-garden
Copy link

When enter is pressed whilst selectr input is focused, this will not trigger the onsubmit event but instead directly submit the form to it's action. This is a problem for ajax forms and although intended as per the onsubmit specifications, I suggest this be changed to align with default behaviour of the standard select field. A fix would be to replace the line
if (that.el.form && typeof that.el.form.submit !== 'undefined') that.el.form.submit();
with
if (that.el.form && typeof that.el.form.submit !== 'undefined') that.el.form.dispatchEvent(new Event('submit'))

@Sandeeprao69
Copy link

Sandeeprao69 commented Aug 13, 2019

I second this solution. submit() will silently submit the form which is not ideal.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants