You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by th...@apache.org on 2020/07/19 15:09:22 UTC

[tapestry-5] 02/02: TAP5-2602: 5.4 LinkSubmit does not work with Prototype JS

This is an automated email from the ASF dual-hosted git repository.

thiagohp pushed a commit to branch java9modules
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git

commit de266a73e70d9bfebb3008f5a6b989742664e48f
Author: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
AuthorDate: Sun Jul 19 12:07:21 2020 -0300

    TAP5-2602: 5.4 LinkSubmit does not work with Prototype JS
---
 .../org/apache/tapestry5/t5-core-dom.coffee                        | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tapestry-core/src/main/preprocessed-coffeescript/org/apache/tapestry5/t5-core-dom.coffee b/tapestry-core/src/main/preprocessed-coffeescript/org/apache/tapestry5/t5-core-dom.coffee
index 7eda282..79c22b0 100644
--- a/tapestry-core/src/main/preprocessed-coffeescript/org/apache/tapestry5/t5-core-dom.coffee
+++ b/tapestry-core/src/main/preprocessed-coffeescript/org/apache/tapestry5/t5-core-dom.coffee
@@ -555,7 +555,12 @@ define ["underscore", "./utils", "./events", "jquery"],
       if memo
         throw new Error "Memo must be null when triggering a native event"
 
-      fireNativeEvent @element, eventName
+      # Hacky solution for TAP5-2602 (5.4 LinkSubmit does not work with Prototype JS)
+      unless Prototype.Browser.WebKit and eventName == 'submit' and @element instanceof HTMLFormElement
+        fireNativeEvent @element, eventName
+      else
+        @element.submit()
+              
 #endif
 
     # With no parameters, returns the current value of the element (which must be a form control element, such as `<input>` or