Problem/Motivation
The horizontal/vertical icons of the toolbar are not always displayed, when the toolbar has multiple items.
This happens for example when other modules like the Workbench module are installed. The module adds the toolbar item "Workbench". I can see the icons, when I click the that "Workbench" toolbar item (see missing_icon2.png), but when I switch to "Manage" I will not see the icons anymore (see missing_icon.png).
I noticed that the buttons have the value "horizontal" or "vertical" when I am on "Workbench". Those values are completely missing when I'm on the other item and since the css uses for example [value="vertical"], it will not apply the styling (in this case the background-image) to the element.
This happens due to some changes of the toolbar's javascript (Issue #3239134):
Before the changes:
const $orientationToggle = this.$el.find('.toolbar-toggle-orientation').toggle(this.model.get('isTrayToggleVisible'));
$orientationToggle.find('button').val(antiOrientation).attr('title',this.strings[antiOrientation]).text(this.strings[antiOrientation]).removeClass(iconClass).addClass(iconAntiClass);
After the changes:
var $orientationToggleButton = $orientationToggle.find('button');
$orientationToggleButton[0].value = antiOrientation;
The [0] only applies the value to the first button, which is from the Workbench tab. That is why the icons are missing for the other tab.
Steps to reproduce
1. Install drupal/workbench module
2. Click the "Manage" tab of the toolbar
3. You should not see the vertical/horizontal Icon in the toolbar
4. Click the "Workbench" tab of the toolbar
5. You should see the vertical/horizontal Icon in the toolbar
Proposed resolution
Revert the changes in the toolbar javascript back to how it was before the change.