mirror of
https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue.git
synced 2024-11-27 09:42:48 +00:00
fix: prevent browser from scrolling to the tab before Tabber updates the aria attributes
Fixes: #161
This commit is contained in:
parent
14becfd4a6
commit
1e5ad6592b
|
@ -683,10 +683,11 @@ async function load( tabberEls ) {
|
|||
setTimeout( () => {
|
||||
// Delay animation execution so it doesn't not animate the tab gets into position on load
|
||||
TabberAction.toggleAnimation( true );
|
||||
window.addEventListener( 'hashchange', () => {
|
||||
window.addEventListener( 'hashchange', ( event ) => {
|
||||
const newHash = window.location.hash.slice( 1 );
|
||||
const tab = document.getElementById( `tab-${ CSS.escape( newHash ) }` );
|
||||
if ( tab ) {
|
||||
event.preventDefault();
|
||||
tab.click();
|
||||
}
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue