summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2021-08-18 11:23:25 +0300
committerGitHub <noreply@github.com>2021-08-18 11:23:25 +0300
commit029f47f1faaa9fd421e01b3b7fc664faf0fcae8f (patch)
tree76243eb072818ffb6a51125176425e417a24c208 /client
parentf0f9b27c67065b4555c9b6e213e02cf24988eb81 (diff)
downloadvaadin-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.java2
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());