File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,6 +157,10 @@ section a:focus {
157157 background-color : var (--amber-100 );
158158}
159159
160+ section pre {
161+ font-size : 16px ;
162+ }
163+
160164section div [tabindex ] {
161165 padding : 10px ;
162166 font-size : 16px ;
Original file line number Diff line number Diff line change @@ -141,9 +141,9 @@ const tabwrap = (rootElement : HTMLElement) : void => {
141141 ? event . key === 'Tab'
142142 : event . keyCode === 9 ;
143143 shiftKeyDetected = event . shiftKey ;
144- activeElement = event . target !== null
145- ? event . target as HTMLElement
146- : null ;
144+ // activeElement = event.target !== null
145+ // ? event.target as HTMLElement
146+ // : null;
147147 } ;
148148
149149 // @ts -ignore no overload matches
@@ -180,17 +180,17 @@ const tabwrap = (rootElement : HTMLElement) : void => {
180180 setUpDocumentListeners ( ) ;
181181 }
182182
183- if ( tabKeyDetected && shiftKeyDetected ) {
184- if ( activeElement !== null && activeElement === getFirstTabbableElement ( ) ) {
183+ if ( tabKeyDetected && ! shiftKeyDetected ) {
184+ if ( activeElement !== null && activeElement === getLastTabbableElement ( ) ) {
185185 event . preventDefault ( ) ;
186186
187- focusLastTabbableElement ( ) ;
187+ focusFirstTabbableElement ( ) ;
188188 }
189- } else if ( tabKeyDetected && ! shiftKeyDetected ) {
190- if ( activeElement !== null && activeElement === getLastTabbableElement ( ) ) {
189+ } else if ( tabKeyDetected && shiftKeyDetected ) {
190+ if ( activeElement !== null && activeElement === getFirstTabbableElement ( ) ) {
191191 event . preventDefault ( ) ;
192192
193- focusFirstTabbableElement ( ) ;
193+ focusLastTabbableElement ( ) ;
194194 }
195195 }
196196 } ) ;
You can’t perform that action at this time.
0 commit comments