Skip to content

Commit

Permalink
Merge pull request #1291 from oasisprotocol/mz/pickerAccessibility
Browse files Browse the repository at this point in the history
Fix keyboard accessibility of layer picker component
  • Loading branch information
buberdds authored Feb 26, 2024
2 parents a8b4c3f + 51d8d63 commit 7a4f764
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changelog/1291.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix keyboard accessibility of layer picker component
3 changes: 2 additions & 1 deletion src/app/components/LayerPicker/LayerDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ export const StyledButton = styled(Button)(({ theme }) => ({
fontSize: 24,
color: COLORS.brandDark,
fontWeight: 700,
'&&:hover, &&:active': {
'&&:hover, &&:active, &&:focus-visible': {
color: COLORS.brandDark,
textDecoration: 'none',
borderRadius: 0,
},
}))

Expand Down
1 change: 1 addition & 0 deletions src/app/components/LayerPicker/LayerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const LayerMenuItem: FC<LayerMenuItemProps> = ({
setSelectedLayer(layer)
}}
selected={activeLayerSelection}
tabIndex={activeLayerSelection ? 0 : -1}
>
<ListItemText>
{labels[layer]}
Expand Down
1 change: 1 addition & 0 deletions src/app/components/LayerPicker/NetworkMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const NetworkMenuItem: FC<NetworkMenuItemProps> = ({
setHoveredNetwork(undefined)
}}
selected={activeNetworkSelection}
tabIndex={activeNetworkSelection ? 0 : -1}
onClick={() => {
setSelectedNetwork(network)
}}
Expand Down

0 comments on commit 7a4f764

Please sign in to comment.