superblocks-lab icon indicating copy to clipboard operation
superblocks-lab copied to clipboard

Pressing enter in some forms does submit the page

Open filippsen opened this issue 6 years ago • 1 comments

Environment/Browser

Version 1.1.0

Description

Pressing enter in some forms does submit the page, which is wrong.

Steps to reproduce

Exact steps are unknown.

Expected result

Nothing.

Actual result

Submit getting called on enter.

filippsen avatar Nov 15 '18 22:11 filippsen

There are multiple form elements in the application. Taking the ones which submit on <enter>, the form used in contract interaction would probably be the one mentioned here. The other elements have to do with renaming.
If that is the case, something like the following would suffice to prevent the reported behavior in contractinteraction.js:

<form id="` +
    prefix +
    item.name +
    `" onkeypress='return event.keyCode != 13;' action="/static/error/404.html" onsubmit="` +
. . .

filippsen avatar Jan 31 '19 19:01 filippsen