Ensure left bar trigger and collapsed state stay in sync #16748
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.
What does it do?
Note that this is an alternative to #16741 that addresses a couple other nuances. Like @rtripault did, I moved the add/remove class logic for the trigger elsewhere (but into the upper collapse/expand blocks for the west region). Alterations were also made to the
toggleLeftBar
method.Why is it needed?
As the original PR stated, the trigger state was not changing when
toggleLeftBar
was called; this method is exclusively used for the keyboard shortcut (which is ctrl-shift-h). A couple other things get resolved with this alternate solution:toggleLeftBar
nothing happens (or the wrong thing happens); this issue was already present before (not caused by the referenced PR).toggleLeftBar
), then actually clicking the trigger icon (or vice versa). This PR ensures the correct state and behavior no matter how you open/close the left bar.How to test
Open and close the left bar by using both the trigger (arrow icon) and using the keyboard shortcut (ctrl-shift-h), in various combinations. Additionally navigate around a bit to verify the correct state is carried through from page to page.
Related issue(s)/PR(s)
None, as mentioned this is an alternate to #16741.