mirror of https://github.com/laurent22/joplin.git
Desktop: Accessibility: Fix input fields not associated with labels (#11700)
parent
98540493e0
commit
68f4b8ed0c
|
@ -39,6 +39,8 @@ interface State {
|
|||
editedValue: any;
|
||||
}
|
||||
|
||||
const uniqueId = (key: string) => `note-properties-dialog-${key}`;
|
||||
|
||||
class NotePropertiesDialog extends React.Component<Props, State> {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
||||
|
@ -281,7 +283,7 @@ class NotePropertiesDialog extends React.Component<Props, State> {
|
|||
const styles = this.styles(this.props.themeId);
|
||||
const theme = themeStyle(this.props.themeId);
|
||||
const labelText = this.formatLabel(key);
|
||||
const labelComp = <label role='rowheader' style={{ ...theme.textStyle, ...theme.controlBoxLabel }}>{labelText}</label>;
|
||||
const labelComp = <label htmlFor={uniqueId(key)} role='rowheader' style={{ ...theme.textStyle, ...theme.controlBoxLabel }}>{labelText}</label>;
|
||||
let controlComp = null;
|
||||
let editComp = null;
|
||||
let editCompHandler = null;
|
||||
|
@ -306,6 +308,8 @@ class NotePropertiesDialog extends React.Component<Props, State> {
|
|||
onChange={event => this.setState({ editedValue: event.target.value })}
|
||||
onKeyDown={event => onKeyDown(event)}
|
||||
style={styles.input}
|
||||
id={uniqueId(key)}
|
||||
name={uniqueId(key)}
|
||||
/>;
|
||||
|
||||
editCompHandler = () => {
|
||||
|
@ -324,6 +328,8 @@ class NotePropertiesDialog extends React.Component<Props, State> {
|
|||
}}
|
||||
onKeyDown={event => onKeyDown(event)}
|
||||
style={styles.input}
|
||||
id={uniqueId(key)}
|
||||
name={uniqueId(key)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue