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:07:35 UTC

[tapestry-5] branch master updated: 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 master
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git


The following commit(s) were added to refs/heads/master by this push:
     new c1e996a  TAP5-2602: 5.4 LinkSubmit does not work with Prototype JS
c1e996a is described below

commit c1e996aa4e11f6f71164b5fe307c20ee9f8875f7
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