fix: make CHRNX header fully progressive
This commit is contained in:
13 files changed
+414
-36
No files matched your search
@@ -48,7 +48,15 @@
|
||||
pair.button.focus();
|
||||
}
|
||||
};
|
||||
const reset = () => pairs.forEach( ( pair ) => setOpen( pair, false ) );
|
||||
const reset = () =>
|
||||
pairs.forEach( ( pair ) => {
|
||||
const wasInsideTarget = pair.target.contains( doc.activeElement );
|
||||
const becomingMobile = isMobile();
|
||||
setOpen( pair, false );
|
||||
if ( becomingMobile && wasInsideTarget ) {
|
||||
pair.button.focus();
|
||||
}
|
||||
} );
|
||||
const onClick = ( event ) => {
|
||||
const pair = pairs.find( ( candidate ) => candidate.button === event.currentTarget );
|
||||
setOpen( pair, pair.button.getAttribute( 'aria-expanded' ) !== 'true' );
|
||||
|
||||
Reference in new issue
Block a user