Fixed ghost tabs issue#15191
Conversation
427d093 to
acc54fb
Compare
Signed-off-by: Raul-Ionut Nastasie <raul-ionut.nastasie@collabora.com> Change-Id: Iecdb07c3708127d4d3eb134508cfd2a02db4c6b9
caolanm
left a comment
There was a problem hiding this comment.
It's not completely clear from the commit message what the original problem to solve is, especially if it needs to be revisited in the future. Be a bit more verbose there, "click X, Y Z and then foo happened when actually bar should happen instead"
| if (!this._isMasterVisible && requestedContext === 'MasterPage') { | ||
| this._isMasterVisible = true; | ||
| } else if (this._isMasterVisible && anotherPageContext) { | ||
| this._isMasterVisible = false; |
There was a problem hiding this comment.
We might already have the information that the masterview is active? There are other places that use e.g.:
var isMasterView = this._map['stateChangeHandler'].getItemValue('.uno:SlideMasterPage');
which checks what core last reported for the master page state. Would that work as an alternative?
There was a problem hiding this comment.
tried using the snippet you gave and it doesn't seem to work properly: if you turn master view on, then select a text box for example the master tab disappears.
There was a problem hiding this comment.
i also looked investigated the object a bit and printing it in the updateTabsVisibility method it does not seem to have anything in _items named SlideMasterPage. Printing the variable you sent me using console.log therefore prints "undefined"
| // Currently selected tab name, part of the element's ID. | ||
| let currentlySelectedTabName = null; | ||
|
|
||
| var anotherPageContext = requestedContext.endsWith('Page') && requestedContext !== 'MasterPage'; |
There was a problem hiding this comment.
What contexts end in Page but are not MasterPage?
There was a problem hiding this comment.
the one I found is DrawPage, that gets called when Master view is toggled off. I suspected there might be more.
Change-Id: Iecdb07c3708127d4d3eb134508cfd2a02db4c6b9
Summary
Context-dependent tabs (such as Master in Impress, Table, Shape) lose the hidden class when selected but did not gain it back when deselected, which made them accessible with arrow key navigation even if they didn't appear in the tab list on top of the screen. The fix makes sure they properly get the hidden class when their context is not met anymore.
TODO
Checklist
make prettier-writeand formatted the code.make checkmake runand manually verified that everything looks okay