Skip to content

Commit

Permalink
Desktop: Accessibility: Make keyboard focus visible for dropdowns (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator authored Oct 15, 2024
1 parent 38be0e8 commit 6afa2d1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,12 @@ const SettingComponent: React.FC<Props> = props => {
);
}

const selectStyle = { ...controlStyle, paddingLeft: 6,
paddingRight: 6,
paddingTop: 4,
paddingBottom: 4,
borderColor: theme.borderColor4,
borderRadius: 3 };

return (
<div style={rowStyle}>
<SettingLabel htmlFor={inputId} text={md.label()}/>
<select
value={value}
style={selectStyle}
className='setting-select-control'
onChange={(event) => {
updateSettingValue(key, event.target.value);
}}
Expand Down
1 change: 1 addition & 0 deletions packages/app-desktop/gui/ConfigScreen/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
@use "./setting-label.scss";
@use "./setting-header.scss";
@use "./setting-tab-panel.scss";
@use "./setting-select-control.scss";
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

.setting-select-control {
display: inline-block;
color: var(--joplin-color);
font-family: var(--joplin-font-family);
background-color: var(--joplin-background-color);

padding-left: 6px;
padding-right: 6px;
padding-top: 4px;
padding-bottom: 4px;
border-radius: 3px;

border-color: var(--joplin-border-color4);

&:focus-visible {
border-color: var(--joplin-focus-outline-color);
outline: none;
}
}
2 changes: 1 addition & 1 deletion packages/app-desktop/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ a {
// sufficient because it matches any focused input (https://stackoverflow.com/a/66109577).
//
// See https://github.com/laurent22/joplin/issues/9982.
input:not([type=button]):not([type=checkbox]), select {
input:not([type=button]):not([type=checkbox]) {
&:focus-visible {
outline: none;
}
Expand Down

0 comments on commit 6afa2d1

Please # to comment.