File tree Expand file tree Collapse file tree
src/frontend/components/UI Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,11 +46,14 @@ const WalletDropdown: React.FC = observer(() => {
4646 const showMetaMaskExtensionLinks =
4747 walletState . isConnected &&
4848 walletState . provider === PROVIDERS . METAMASK_EXTENSION
49+ const [ opened , setOpened ] = React . useState ( false )
4950
5051 return (
5152 < Menu
5253 position = "bottom-end"
5354 trigger = "hover"
55+ opened = { opened }
56+ onChange = { setOpened }
5457 zIndex = { 100001 }
5558 classNames = { {
5659 dropdown : styles . menuDropdown ,
@@ -64,6 +67,7 @@ const WalletDropdown: React.FC = observer(() => {
6467 onClick = { ( ) => {
6568 console . log ( 'wallet clicked' )
6669 } }
70+ onFocus = { ( ) => setOpened ( true ) }
6771 />
6872 </ div >
6973 </ Menu . Target >
Original file line number Diff line number Diff line change @@ -58,10 +58,33 @@ const TopNavBar = observer(() => {
5858 }
5959 }
6060 }
61+
62+ // Right arrow navigation on /library page
63+ if ( e . key === 'ArrowRight' && pathname === '/library' ) {
64+ const activeEl = document . activeElement as HTMLElement | null
65+
66+ // From MetaMask button -> Account dropdown
67+ if ( activeEl ?. closest ( '#topbarMetaMaskButton' ) ) {
68+ const accountBtn = document . getElementById ( 'accountWalletContainer' )
69+ if ( accountBtn ) {
70+ accountBtn . focus ( )
71+ e . preventDefault ( )
72+ e . stopPropagation ( )
73+ }
74+ return
75+ }
76+
77+ // From Account dropdown -> stay there
78+ if ( activeEl ?. closest ( '#accountWalletContainer' ) ) {
79+ e . preventDefault ( )
80+ e . stopPropagation ( )
81+ return
82+ }
83+ }
6184 }
6285 nav . addEventListener ( 'keydown' , onKeyDown )
6386 return ( ) => nav . removeEventListener ( 'keydown' , onKeyDown )
64- } , [ ] )
87+ } , [ pathname ] )
6588
6689 function getStoreTextStyle ( viewURL : string ) {
6790 const { currentUrl } = webviewNavigationStore
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import walletState from '../../../state/WalletState'
88
99interface WalletProps {
1010 onClick : ( ) => void
11+ onFocus ?: ( ) => void
1112}
1213
1314const WalletProviderIcons : Record < PROVIDERS , ReactNode > = {
@@ -23,6 +24,7 @@ const Wallet: React.FC<WalletProps> = observer((props) => {
2324 return (
2425 < button
2526 onClick = { props . onClick }
27+ onFocus = { props . onFocus }
2628 className = { styles . walletButton }
2729 id = "accountWalletContainer"
2830 >
You can’t perform that action at this time.
0 commit comments