[
https://issues.apache.org/jira/browse/WICKET-7140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17913992#comment-17913992
]
ASF GitHub Bot commented on WICKET-7140:
----------------------------------------
martin-g commented on code in PR #1076:
URL: https://github.com/apache/wicket/pull/1076#discussion_r1919718328
##########
wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.js:
##########
@@ -1,6 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
function handleDefaultSubmit(event, submitId, keyStroke) {
- const tag = event.target.tagName.toLowerCase();
- const contenteditable = event.target.getAttribute('contenteditable') ===
'true';
+ var tag = event.target.tagName.toLowerCase();
Review Comment:
> Can I updated javascript languageIn version from `ECMASCRIPT3` to at least
`ECMASCRIPT_2015` in `resources-optimizer-maven-plugin`?
I think it is about time!
> 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
> 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)