diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2021-08-18 11:23:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 11:23:25 +0300 |
commit | 029f47f1faaa9fd421e01b3b7fc664faf0fcae8f (patch) | |
tree | 76243eb072818ffb6a51125176425e417a24c208 /client | |
parent | f0f9b27c67065b4555c9b6e213e02cf24988eb81 (diff) | |
download | vaadin-framework-029f47f1faaa9fd421e01b3b7fc664faf0fcae8f.tar.gz vaadin-framework-029f47f1faaa9fd421e01b3b7fc664faf0fcae8f.zip |
Ensure visible tab search only covers existing tabs. (#12373)
Fixes #11673
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/VTabsheet.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VTabsheet.java b/client/src/main/java/com/vaadin/client/ui/VTabsheet.java index e994623d99..6297bbcde2 100644 --- a/client/src/main/java/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/main/java/com/vaadin/client/ui/VTabsheet.java @@ -1046,6 +1046,7 @@ public class VTabsheet extends VTabsheetBase * @see VTabsheet#isClipped(Tab) */ private int getNextVisibleTab(int i) { + i = Math.max(i, -1); int tabs = getTabCount(); do { i++; @@ -1082,6 +1083,7 @@ public class VTabsheet extends VTabsheetBase * @see VTabsheet#isClipped(Tab) */ private int getPreviousVisibleTab(int i) { + i = Math.min(i, getTabCount()); do { i--; } while (i >= 0 && getTab(i).isHiddenOnServer()); |