Solved issue with disappearing tabs#15488
Open
misespuneraul wants to merge 1 commit intoCollaboraOnline:mainfrom
Open
Solved issue with disappearing tabs#15488misespuneraul wants to merge 1 commit intoCollaboraOnline:mainfrom
misespuneraul wants to merge 1 commit intoCollaboraOnline:mainfrom
Conversation
Signed-off-by: Raul-Ionut Nastasie <raul-ionut.nastasie@collabora.com> Change-Id: If4964548334cd8ed8461b3a9c4b4be5f0dfc837c
caolanm
reviewed
Apr 14, 2026
| else | ||
| alreadySelected = tabElement; | ||
| // break so that next contexts don't add hidden on top of selected | ||
| break; |
Contributor
There was a problem hiding this comment.
I'm worried about the break, its here because of the addClass('hidden;) inside the loop, so its a consequence of that.
How about...
adding a var matched = false; before the loop, then just do
matched = true; here, and no break;
and after the for loop have:
if (!matched) {
tabElement.addClass('hidden');
}
so then the addition of 'hidden' is outside the loop. Then, presumably, you don't need the name !=== 'Home' condition?
It then probably makes sense to make the 'default' match also do the same:
tabElement.removeClass('hidden');
and
matched = true;
?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change-Id: If4964548334cd8ed8461b3a9c4b4be5f0dfc837c
Before, if for example a shape was selected the "Shape" tab would lose its "hidden" class to gain "selected". If the shape was deselected, the "Shape" tab would not gain back its "hidden" class.
Because of this, when moving through tabs using keyboard keys, the shape tab would still be accessible, even if no shape was selected. This applied to all context-dependent tabs.
Summary
TODO
Checklist
make prettier-writeand formatted the code.make checkmake runand manually verified that everything looks okay