11/* ========================================================================
2- * Version: 5.9.0
2+ * Version: 5.9.2
33 * Copyright (c) 2022, 2023, 2024, 2025 Jon Gunderson; Licensed BSD
44 * Copyright (c) 2021 PayPal Accessibility Team and University of Illinois; Licensed BSD
55 * All rights reserved.
550550 z-index: var(--skipto-z-index-1);
551551}
552552
553- .menu-button button .popup {
553+ .menu-button.popup {
554554 top: var(--skipto-popup-offset);
555555 transition: top 0.35s ease;
556556}
557557
558- .menu-button button .popup.show-border {
558+ .menu-button.popup.show-border {
559559 top: var(--skipto-show-border-offset);
560560 transition: top 0.35s ease;
561561}
575575 display: none;
576576}
577577
578- .menu-button button {
578+ .menu-button {
579579 position: fixed;
580580 left: var(--skipto-position-left);
581+ z-index: var(--skipto-z-index-1) !important;
582+ }
583+
584+ .menu-button button {
581585 margin: 0;
582586 padding: 0;
583587 border-width: 0px 1px 1px 1px;
586590 border-color: light-dark(var(--skipto-button-background-color), var(--skipto-button-background-dark-color));
587591 color: light-dark(var(--skipto-button-text-color), var(--skipto-button-text-dark-color));
588592 background-color: light-dark(var(--skipto-button-background-color), var(--skipto-button-background-dark-color));
589- z-index: 100000 !important;
590- z-index: var(--skipto-z-index-1) !important;
591593 font-size: var(--skipto-font-size);
592594 font-family: var(--skipto-font-family);
593595}
594596
595597@media screen and (max-width: var(--skipto-small-break-point)) {
596- .menu-button button :not(.popup) .skipto-small {
598+ .menu-button:not(.popup) button .skipto-small {
597599 transition: top 0.35s ease;
598600 display: inline-block;
599601 }
600602
601- .menu-button button :not(.popup) .skipto-text,
602- button:not(.popup) .skipto-medium {
603+ .menu-button:not(.popup) button .skipto-text,
604+ .menu- button:not(.popup) button .skipto-medium {
603605 transition: top 0.35s ease;
604606 display: none;
605607 }
606608
607- .menu-button button :not(.popup):focus .skipto-text {
609+ .menu-button:not(.popup) button :focus .skipto-text {
608610 transition: top 0.35s ease;
609611 display: inline-block;
610612 }
611613
612- .menu-button button :not(.popup):focus .skipto-small,
613- .menu-button button :not(.popup):focus .skipto-medium {
614+ .menu-button:not(.popup) button :focus .skipto-small,
615+ .menu-button:not(.popup) button :focus .skipto-medium {
614616 transition: top 0.35s ease;
615617 display: none;
616618 }
617619}
618620
619621@media screen and (min-width: var(--skipto-small-break-point)) and (max-width: var(--skipto-medium-break-point)) {
620- .menu-button button :not(.popup) .skipto-medium {
622+ .menu-button:not(.popup) button .skipto-medium {
621623 transition: top 0.35s ease;
622624 display: inline-block;
623625 }
624626
625- .menu-button button :not(.popup) .skipto-text,
626- .menu-button button :not(.popup) .skipto-small {
627+ .menu-button:not(.popup) button .skipto-text,
628+ .menu-button:not(.popup) button .skipto-small {
627629 transition: top 0.35s ease;
628630 display: none;
629631 }
630632
631- .menu-button button :not(.popup):focus .skipto-text {
633+ .menu-button:not(.popup) button :focus .skipto-text {
632634 transition: top 0.35s ease;
633635 display: inline-block;
634636 }
635637
636- .menu-button button :not(.popup):focus .skipto-small,
637- .menu-button button :not(.popup):focus .skipto-medium {
638+ .menu-button:not(.popup) button :focus .skipto-small,
639+ .menu-button:not(.popup) button :focus .skipto-medium {
638640 transition: top 0.35s ease;
639641 display: none;
640642 }
641643}
642644
643- .menu-button button .static {
645+ .menu-button.static {
644646 position: absolute !important;
645647}
646648
804806 border-color: light-dark(var(--skipto-focus-border-color), var(--skipto-focus-border-dark-color));
805807}
806808
807- .menu-button button .popup.menu ,
808- .menu-button button .popup:focus ,
809- .menu-button button .popup:hover {
809+ .menu-button.popup.focus ,
810+ .menu-button.popup.menu ,
811+ .menu-button.popup:hover {
810812 top: 0;
811813 display: block;
812814 transition: left 1s ease;
@@ -1421,22 +1423,21 @@ dialog button:hover {
14211423 updateStyle ( containerNode , '--skipto-z-index-1' , config . zIndex , theme . zIndex , d . zIndex ) ;
14221424
14231425
1426+ const menuButtonNode = containerNode . querySelector ( '.menu-button' ) ;
14241427 const buttonNode = containerNode . querySelector ( 'button' ) ;
14251428 const rect = buttonNode . getBoundingClientRect ( ) ;
1426- if ( buttonNode . classList . contains ( 'show-border' ) ) {
1429+ if ( menuButtonNode . classList . contains ( 'show-border' ) ) {
14271430 const borderOffset = - 1 * rect . height + 4 + 'px' ;
14281431 containerNode . style . setProperty ( '--skipto-show-border-offset' , borderOffset ) ;
14291432 }
14301433 else {
1431- if ( buttonNode . classList . contains ( 'popup' ) ) {
1434+ if ( menuButtonNode . classList . contains ( 'popup' ) ) {
14321435 const popupOffset = - 1 * rect . height - 6 + 'px' ;
14331436 containerNode . style . setProperty ( '--skipto-popup-offset' , popupOffset ) ;
14341437 }
14351438 }
14361439 containerNode . style . setProperty ( '--skipto-menu-offset' , rect . height + 'px' ) ;
14371440
1438-
1439-
14401441 const zIndex2 = config . zIndex ?
14411442 ( parseInt ( config . zIndex ) + 1 ) . toString ( ) :
14421443 '2000001' ;
@@ -1584,7 +1585,7 @@ dialog button:hover {
15841585 Happy Skipping!
15851586 </div>
15861587 <div class="version">
1587- Version 5.9.0
1588+ Version 5.9.1
15881589 </div>
15891590 <div class="copyright">
15901591 BSD License, Copyright 2021-2025
@@ -3590,8 +3591,6 @@ dialog button:hover {
35903591 node . hasAttribute ( 'data-skip-to-acc-name' ) &&
35913592 node . getAttribute ( 'data-skip-to-acc-name' ) . trim ( ) . length > 0 ) ) ) {
35923593
3593- if ( target . includes ( 'heading' ) )
3594-
35953594 if ( ! firstNode &&
35963595 isVisible ( node ) ) {
35973596 firstNode = node ;
@@ -3682,6 +3681,8 @@ dialog button:hover {
36823681 ( passElem . parentNode && ( passElem . parentNode . id === SKIP_TO_ID ) ) ;
36833682 let node = transverseDOMForElement ( document . body ) ;
36843683
3684+ debug$4 . log ( `[node]: ${ node } [useFirst]: ${ useFirst } [firstNode]: ${ firstNode } ` ) ;
3685+
36853686 if ( ! node && useFirst && firstNode ) {
36863687 node = firstNode ;
36873688 }
@@ -3939,12 +3940,13 @@ dialog button:hover {
39393940 if ( isNotEmptyString ( this . config . customClass ) ) {
39403941 this . menuButtonNode . classList . add ( this . config . customClass ) ;
39413942 }
3943+ this . setDisplayOption ( this . menuButtonNode , this . config . displayOption ) ;
39423944
3943- // Create button
3945+ this . menuButtonNode . appendChild ( templateMenuButton . content . cloneNode ( true ) ) ;
39443946
3945- const [ buttonVisibleLabel , buttonAriaLabel ] = this . getBrowserSpecificShortcut ( this . config ) ;
3947+ // Setup button
39463948
3947- this . menuButtonNode . appendChild ( templateMenuButton . content . cloneNode ( true ) ) ;
3949+ const [ buttonVisibleLabel , buttonAriaLabel ] = this . getBrowserSpecificShortcut ( this . config ) ;
39483950
39493951 this . buttonNode = this . containerNode . querySelector ( 'button' ) ;
39503952 this . buttonNode . setAttribute ( 'aria-label' , buttonAriaLabel ) ;
@@ -3960,7 +3962,6 @@ dialog button:hover {
39603962 this . mediumButtonNode = this . buttonNode . querySelector ( 'span.skipto-medium' ) ;
39613963 this . mediumButtonNode . textContent = this . config . buttonLabel ;
39623964
3963- this . setDisplayOption ( this . config . displayOption ) ;
39643965
39653966 // Create menu container
39663967 this . menuitemNodes = [ ] ;
@@ -4740,29 +4741,30 @@ dialog button:hover {
47404741 * @desc Set display option for button visibility wehn it does not
47414742 * have focus
47424743 *
4744+ * @param {Object } elem - DOM element to update style
47434745 * @param {String } value - String with configuration information
47444746 */
4745- setDisplayOption ( value ) {
4747+ setDisplayOption ( elem , value ) {
47464748
47474749 if ( typeof value === 'string' ) {
47484750 value = value . trim ( ) . toLowerCase ( ) ;
4749- if ( value . length && this . buttonNode ) {
4751+ if ( value . length && elem ) {
47504752
4751- this . buttonNode . classList . remove ( 'static' ) ;
4752- this . buttonNode . classList . remove ( 'popup' ) ;
4753- this . buttonNode . classList . remove ( 'show-border' ) ;
4753+ elem . classList . remove ( 'static' ) ;
4754+ elem . classList . remove ( 'popup' ) ;
4755+ elem . classList . remove ( 'show-border' ) ;
47544756
47554757 switch ( value ) {
47564758 case 'static' :
4757- this . buttonNode . classList . add ( 'static' ) ;
4759+ elem . classList . add ( 'static' ) ;
47584760 break ;
47594761 case 'onfocus' : // Legacy option
47604762 case 'popup' :
4761- this . buttonNode . classList . add ( 'popup' ) ;
4763+ elem . classList . add ( 'popup' ) ;
47624764 break ;
47634765 case 'popup-border' :
4764- this . buttonNode . classList . add ( 'popup' ) ;
4765- this . buttonNode . classList . add ( 'show-border' ) ;
4766+ elem . classList . add ( 'popup' ) ;
4767+ elem . classList . add ( 'show-border' ) ;
47664768 break ;
47674769 }
47684770 }
@@ -4772,12 +4774,12 @@ dialog button:hover {
47724774 // Menu event handlers
47734775
47744776 handleFocusin ( ) {
4775- this . buttonNode . classList . add ( 'focus' ) ;
4777+ this . menuButtonNode . classList . add ( 'focus' ) ;
47764778 this . skipToContentElem . setAttribute ( 'focus' , 'button' ) ;
47774779 }
47784780
47794781 handleFocusout ( ) {
4780- this . buttonNode . classList . remove ( 'focus' ) ;
4782+ this . menuButtonNode . classList . remove ( 'focus' ) ;
47814783 this . skipToContentElem . setAttribute ( 'focus' , 'none' ) ;
47824784 }
47834785
@@ -4877,23 +4879,23 @@ dialog button:hover {
48774879 case this . config . shortcutRegionComplementary :
48784880 elem = navigateContent ( 'complementary' , 'next' , this . config . msgHeadingLevel , true ) ;
48794881 if ( ! elem ) {
4880- this . shortcutsMessage . open ( this . config . msgNoMoreRegions . replace ( '%r' , 'complementary' ) ) ;
4882+ this . shortcutsMessage . open ( this . config . msgNoRegionsFound . replace ( '%r' , 'complementary' ) ) ;
48814883 }
48824884 flag = true ;
48834885 break ;
48844886
48854887 case this . config . shortcutRegionMain :
48864888 elem = navigateContent ( 'main' , 'next' , this . config . msgHeadingLevel , true ) ;
48874889 if ( ! elem ) {
4888- this . shortcutsMessage . open ( this . config . msgNoMoreRegions . replace ( '%r' , 'main' ) ) ;
4890+ this . shortcutsMessage . open ( this . config . msgNoRegionsFound . replace ( '%r' , 'main' ) ) ;
48894891 }
48904892 flag = true ;
48914893 break ;
48924894
48934895 case this . config . shortcutRegionNavigation :
48944896 elem = navigateContent ( 'navigation' , 'next' , this . config . msgHeadingLevel , true ) ;
48954897 if ( ! elem ) {
4896- this . shortcutsMessage . open ( this . config . msgNoMoreRegions . replace ( '%r' , 'navigation' ) ) ;
4898+ this . shortcutsMessage . open ( this . config . msgNoRegionsFound . replace ( '%r' , 'navigation' ) ) ;
48974899 }
48984900 flag = true ;
48994901 break ;
@@ -5225,7 +5227,7 @@ dialog button:hover {
52255227 // Always call super first in constructor
52265228 super ( ) ;
52275229 this . attachShadow ( { mode : 'open' } ) ;
5228- this . version = "5.9.0 " ;
5230+ this . version = "5.9.2 " ;
52295231 this . buttonSkipTo = false ;
52305232 this . initialized = false ;
52315233
0 commit comments