Skip to content

Solved issue with disappearing tabs#15488

Open
misespuneraul wants to merge 1 commit intoCollaboraOnline:mainfrom
misespuneraul:ghost-tabs-26
Open

Solved issue with disappearing tabs#15488
misespuneraul wants to merge 1 commit intoCollaboraOnline:mainfrom
misespuneraul:ghost-tabs-26

Conversation

@misespuneraul
Copy link
Copy Markdown

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.

  • Resolves: #
  • Target version: main

Summary

TODO

  • ...

Checklist

  • I have run make prettier-write and formatted the code.
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

Signed-off-by: Raul-Ionut Nastasie <raul-ionut.nastasie@collabora.com>
Change-Id: If4964548334cd8ed8461b3a9c4b4be5f0dfc837c
else
alreadySelected = tabElement;
// break so that next contexts don't add hidden on top of selected
break;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Review

Development

Successfully merging this pull request may close these issues.

2 participants