diff --git a/extends.js b/extends.js index 26634e09b5..8a24f1cbd9 100644 --- a/extends.js +++ b/extends.js @@ -1,9 +1,9 @@ /* extends.js Purpose: - + Description: - + History: 1:02 PM 2023/8/21, Created by jumperchen @@ -18,8 +18,9 @@ var extendStatics = function(d, b) { // refer tslib#__extends export default function (d, b) { + const len = Object.keys(d.prototype).length; // Potix: Jumper Chen adds to support `$supers(foo.Bar, 'bind_')` extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - d.prototype._$super = d.name == '$subclass$' && b.prototype._$super ? b.prototype._$super : b.prototype; // Potix: Jumper Chen adds to support `$supers(foo.Bar, 'bind_')` + d.prototype._$super = len === 0 && b.prototype._$super ? b.prototype._$super : b.prototype; // Potix: Jumper Chen adds to support `$supers(foo.Bar, 'bind_')` } \ No newline at end of file diff --git a/zkdoc/release-note b/zkdoc/release-note index 7018d0b23d..5c329e4eb1 100644 --- a/zkdoc/release-note +++ b/zkdoc/release-note @@ -15,6 +15,7 @@ ZK 10.1.0 ZK-5703: Debug messages shouldn't be created if debug is disabled, may cause side effects ZK-5716: Errorbox contains inline script ZK-5787: aria-hidden elements do not contain focusable elements + ZK-5743: clicking menuitem fires 2 onClick events in mobile browser * Upgrade Notes + Remove Htmls.encodeJavaScript(), Strings.encodeJavaScript(), Strings.escape() with Strings.ESCAPE_JAVASCRIPT, and replace them with OWASP Java Encoder APIs instead. diff --git a/zktest/src/main/webapp/test2/B101-ZK-5743-zk.xml b/zktest/src/main/webapp/test2/B101-ZK-5743-zk.xml new file mode 100644 index 0000000000..0dba55dc88 --- /dev/null +++ b/zktest/src/main/webapp/test2/B101-ZK-5743-zk.xml @@ -0,0 +1,11 @@ + + + + false + + + + org.zkoss.zkmax.tablet.ui.disabled + false + + \ No newline at end of file diff --git a/zktest/src/main/webapp/test2/B101-ZK-5743.zul b/zktest/src/main/webapp/test2/B101-ZK-5743.zul new file mode 100644 index 0000000000..6ef0d0d9cf --- /dev/null +++ b/zktest/src/main/webapp/test2/B101-ZK-5743.zul @@ -0,0 +1,25 @@ + + + + +
+ + + + +
+
\ No newline at end of file diff --git a/zktest/src/main/webapp/test2/config.properties b/zktest/src/main/webapp/test2/config.properties index d38e1ccd7d..127d594b3c 100644 --- a/zktest/src/main/webapp/test2/config.properties +++ b/zktest/src/main/webapp/test2/config.properties @@ -3134,6 +3134,7 @@ B90-ZK-4431.zul=A,E,Multislider ##zats##B101-ZK-5696.zul=A,E,NestedShadow,ServerMVVM,ForEach,Differ ##zats##B101-ZK-5716.zul=A,E,CSP,Security,Content-Security-Policy,Unsafe-inline ##zats##B101-ZK-5787.zul=A,E,WCAG,Accessibility,Focus,Tabindex,Aria-hidden +##zats##B101-ZK-5743.zul=A,E,Compressed,JS,Debug-JS,TabletUI,Mobile,onClick ## # Features - 3.0.x version diff --git a/zktest/src/test/java/org/zkoss/zktest/zats/test2/B101_ZK_5743Test.java b/zktest/src/test/java/org/zkoss/zktest/zats/test2/B101_ZK_5743Test.java new file mode 100644 index 0000000000..8393f1b511 --- /dev/null +++ b/zktest/src/test/java/org/zkoss/zktest/zats/test2/B101_ZK_5743Test.java @@ -0,0 +1,51 @@ +/* B101_ZK_5743Test.java + + Purpose: + + Description: + + History: + 12:17 PM 2024/9/13, Created by jumperchen + +Copyright (C) 2024 Potix Corporation. All Rights Reserved. +*/ +package org.zkoss.zktest.zats.test2; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.Collections; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.openqa.selenium.chrome.ChromeOptions; + +import org.zkoss.test.webdriver.ExternalZkXml; +import org.zkoss.test.webdriver.ForkJVMTestOnly; +import org.zkoss.test.webdriver.WebDriverTestCase; + +/** + * @author jumperchen + */ +@ForkJVMTestOnly +public class B101_ZK_5743Test extends WebDriverTestCase { + + @RegisterExtension + public static final ExternalZkXml CONFIG = new ExternalZkXml( + B101_ZK_5743Test.class); + + @Override + protected ChromeOptions getWebDriverOptions() { + return super.getWebDriverOptions() + .setExperimentalOption("mobileEmulation", Collections.singletonMap("deviceName", "iPad")); + } + + @Test + public void test() { + connect(); + click(jq("@menuitem")); + waitResponse(); + String zkLog = getZKLog(); + long count = zkLog.split("onClick").length - 1; + assertEquals(1, count); + } +}