1azyman commented on code in PR #1076:
URL: https://github.com/apache/wicket/pull/1076#discussion_r1914770541


##########
wicket-core/src/main/java/org/apache/wicket/markup/html/form/Form.java:
##########
@@ -1273,9 +1273,11 @@ protected void 
addDefaultSubmitButtonHandler(IHeaderResponse headerResponse)
                String submitId = component.getMarkupId();
 
                AppendingStringBuffer script = new AppendingStringBuffer();
-               script.append("var b = 
document.getElementById('").append(submitId).append("');");
-               script.append("if (window.getComputedStyle(b).visibility === 
'hidden') return;");
-               script.append("if (event.which == 13) {");
+               script.append("if (event.which != 13) return true;");
+               // text area will submit on CTRL+Enter
+               script.append("if (event.target.tagName.toLowerCase() === 
'textarea' && !event.ctrlKey) return true;");

Review Comment:
   good idea about that contenteditable. AFAIK previously there were no special 
handling for textarea/contenteditabl.
   It was handled via hidden input that was defined only in root form with 
onclick event that was handled by script in 
`Form.addDefaultSubmitButtonHandler()`. Currently it's handled by catching 
keypress event handler in each relevant form.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to