diff --git a/zkdoc/release-note b/zkdoc/release-note index a7e3cf379e6..735de8df9c8 100644 --- a/zkdoc/release-note +++ b/zkdoc/release-note @@ -54,6 +54,7 @@ ZK 10.0.0 ZK-5468: Components with Model only renders one item with wrong result if the EL contains forEachStatus.index ZK-5490: Grid's [aria-*] attributes do not match their roles ZK-5525: Checkbox tristate [aria-checked] attribute missing "mixed" state + ZK-5235: Opening a menupopup moves a scrollbar of a long menu back to top * Upgrade Notes @@ -74,6 +75,7 @@ ZK 10.0.0 + Remove Acronym, Big, Center, Dir, Font, isindex, Nobr, Param, Rtc, and Tt in ZHTML module + Remove Applet, Flash, and FusionChart components since ZK 10.0.0 + Deprecated org.zkoss.zk.ui.uuidRecycle.disabled since ZK 10.0.0 + + Revert ZK-5026 which the original bug cannot be reproduced to fix ZK-5235. -------- ZK 9.6.4 diff --git a/zktest/src/main/webapp/test2/B100-ZK-5235.zul b/zktest/src/main/webapp/test2/B100-ZK-5235.zul new file mode 100644 index 00000000000..79cb7542283 --- /dev/null +++ b/zktest/src/main/webapp/test2/B100-ZK-5235.zul @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + \ 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 96636ccd2a3..318c5832868 100644 --- a/zktest/src/main/webapp/test2/config.properties +++ b/zktest/src/main/webapp/test2/config.properties @@ -3157,6 +3157,7 @@ B90-ZK-4431.zul=A,E,Multislider ##zats##B100-ZK-5468-Stepbar.zul=A,E,Model,Stepbar ##zats##B100-ZK-5468-Tabbox.zul=A,E,Model,Tabbox ##zats##B100-ZK-5468-Tree.zul=A,E,Model,Tree +##zats##B100-ZK-5235.zul=A,E,Menu,Menupopup,focus ## # Features - 3.0.x version diff --git a/zktest/src/test/java/org/zkoss/zktest/zats/test2/B100_ZK_5235Test.java b/zktest/src/test/java/org/zkoss/zktest/zats/test2/B100_ZK_5235Test.java new file mode 100644 index 00000000000..26f48e4ceff --- /dev/null +++ b/zktest/src/test/java/org/zkoss/zktest/zats/test2/B100_ZK_5235Test.java @@ -0,0 +1,37 @@ +/* B100_ZK_5235Test.java + + Purpose: + + Description: + + History: + Mon Aug 21 13:04:26 CST 2023, Created by rebeccalai + +Copyright (C) 2023 Potix Corporation. All Rights Reserved. +*/ +package org.zkoss.zktest.zats.test2; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; +import org.openqa.selenium.interactions.Actions; + +import org.zkoss.test.webdriver.WebDriverTestCase; + +/** + * @author rebeccalai + */ +public class B100_ZK_5235Test extends WebDriverTestCase { + @Test + public void test() { + Actions act = new Actions(connect()); + + click(jq("$longMenu")); + waitResponse(); + assertTrue(jq(".z-menupopup-open").isVisible()); + + act.moveToElement(toElement(jq("$childMenu"))).perform(); + waitResponse(); + assertTrue(jq("$childMenu").hasClass("z-menu-hover")); + } +} diff --git a/zktest/src/test/java/org/zkoss/zktest/zats/test2/B96_ZK_5026Test.java b/zktest/src/test/java/org/zkoss/zktest/zats/test2/B96_ZK_5026Test.java index b31882e36f9..f984e4e7882 100644 --- a/zktest/src/test/java/org/zkoss/zktest/zats/test2/B96_ZK_5026Test.java +++ b/zktest/src/test/java/org/zkoss/zktest/zats/test2/B96_ZK_5026Test.java @@ -19,6 +19,7 @@ import org.openqa.selenium.interactions.Actions; import org.zkoss.test.webdriver.WebDriverTestCase; +import org.zkoss.test.webdriver.ztl.JQuery; /** * @author jumperchen @@ -55,10 +56,11 @@ public void test() { .perform(); assertTrue(jq(" .z-menuitem.z-menuitem-hover").exists()); + JQuery childMenupopup = jq(".z-menupopup-content").eq(1); act.sendKeys(Keys.DOWN).perform(); - assertTrue(jq(".z-menupopup-content > .z-menuitem:nth-child(2)").hasClass("z-menuitem-hover")); + assertTrue(childMenupopup.children(".z-menuitem:first-child").hasClass("z-menuitem-hover")); act.sendKeys(Keys.DOWN).perform(); - assertTrue(jq(".z-menupopup-content > .z-menuitem:nth-child(3)").hasClass("z-menuitem-hover")); + assertTrue(childMenupopup.children(".z-menuitem:nth-child(2)").hasClass("z-menuitem-hover")); } } diff --git a/zul/src/main/resources/web/js/zul/menu/Menupopup.ts b/zul/src/main/resources/web/js/zul/menu/Menupopup.ts index 4dd1eeb1a93..89bd479b6f9 100644 --- a/zul/src/main/resources/web/js/zul/menu/Menupopup.ts +++ b/zul/src/main/resources/web/js/zul/menu/Menupopup.ts @@ -564,10 +564,6 @@ export class Menupopup extends zul.wgt.Popup { /** @internal */ addActive_(wgt: zk.Widget): void { - // ZK-5026 - if (zk.currentFocus != this) { - this.getAnchor_()?.focus(); - } this._curIndex = _indexOfVisibleMenu(this, wgt); }