[ 
https://issues.apache.org/jira/browse/WICKET-7140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17916147#comment-17916147
 ] 

ASF subversion and git services commented on WICKET-7140:
---------------------------------------------------------

Commit 69f1eb7f405a0006cd8822b631b900ae2038a46d in wicket's branch 
refs/heads/dependabot/npm_and_yarn/testing/wicket-js-tests/grunt-contrib-qunit-10.1.1
 from Viliam Repan
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=69f1eb7f40 ]

WICKET-7140 fix for textarea submit on enter (now ctrl+enter) (#1076)

* WICKET-7140 fix for textarea submit on enter if form.defaultButton is set 
(now submits on CTRL+enter for textarea)

* WICKET-7140 indentation fix

* WICKET-7140 improvement for textarea and contenteditable

* WICKET-7140 form default submit js moved out to separate file, default 
handling for textarea/contenteditable is NONE (no action)

* WICKET-7140 build fix

* upgraded resource optimizer javascript language level from ecmascript_3 to 
ecmascript_2015

* WICKET-7140 changed var/let variable definitions to const

* WICKET-7140 minor improvements in examples

* WICKET-7140 simplified JS and embedded, textarea/contenteditable not handled 
at all

* WICKET-7140 fixed tests

* WICKET-7140 JS language version moved back to ES 3 (default)

> Form submit triggered by pressing return in textareas
> -----------------------------------------------------
>
>                 Key: WICKET-7140
>                 URL: https://issues.apache.org/jira/browse/WICKET-7140
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 10.3.0
>            Reporter: Thomas Heigl
>            Priority: Major
>             Fix For: 10.4.0
>
>         Attachments: wicket-bug.zip
>
>
> Since upgrading to Wicket 10.3.0, pressing return in a textarea submits the 
> form when a `form.setDefaultButton()` is set. Downgrading to 10.2.0 fixes the 
> problem.
> Minimal reproducer:
> {code:java}
> public class HomePage extends WebPage {
>     public HomePage(final PageParameters pp) {
>        super(pp);
>        final Form<?> form = new Form<>("form");
>        form.add(new TextArea<>("textArea", new Model<>()));
>        final AjaxSubmitLink link = new AjaxSubmitLink("submit") {
>           @Override
>           protected void onSubmit(AjaxRequestTarget target) {
>              target.appendJavaScript("alert('Submitted');");
>           }
>        };
>        form.add(link);
>        form.setDefaultButton(link);
>        add(form);
>     }
> } {code}
> Click into the textarea and press return/enter.
> See also the attached quickstart.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to