The VerticalTabs render component needs the hidden input field for "'#default_value" to have its class attribute updated to match the BEM standard being used by the JavaScript library to set the #default_tab.
Line 139: /core/lib/Drupal/Core/Render/Element/VerticalTabs.php
'#attributes' => array('class' => array('vertical-tabs-active-tab')),
... should be
'#attributes' => array('class' => array('vertical-tabs__active-tab')),
... so that the vertical-tabs.js
var focusID = $this.find(':hidden.vertical-tabs__active-tab').val();
... will find and set the default tab.
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
VerticalTabs.php_.patch | 758 bytes | anthony.bouch | |
Comments
Comment #2
imalabyaComment #3
anthony.bouch CreditAttribution: anthony.bouch as a volunteer commentedComment #4
anthony.bouch CreditAttribution: anthony.bouch as a volunteer commentedComment #5
Wim LeersConfirmed, ran into this problem over at #2294613: Port CDN to Drupal 8.
I independently arrived at the same patch.
Comment #6
alexpottCommitted c4be3d5 and pushed to 8.0.x, 8.1.x and 8.2.x. Thanks!
I've committing this to 8.0.x as well because whilst this is changing a class name it intended use in the js is completely broken.
Comment #10
anthony.bouch CreditAttribution: anthony.bouch as a volunteer commentedw00t! my first (albeit tiny) commit to core. Thanks for the review and confirmation @malavya @Wim Leers, and the fast commit @alexpott.
Comment #11
Wim LeersCongrats, @blue_waters! Great work :)