Skip to content

Commit

Permalink
Fix keyboard navigation changing settings in App settings
Browse files Browse the repository at this point in the history
When using keyboard navigation `onBlur` and `onChange` on radio buttons caused settings to be changed.

Uses `onClick` instead and replaces `onChange` with a noop to prevent react from complaining.

Signed-off-by: Plastikmensch <[email protected]>
  • Loading branch information
Plastikmensch committed Nov 5, 2023
1 parent 3b49b5a commit dc2aa6a
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ export default class LocalSettingsPageItem extends PureComponent {
else onChange(item, target.checked);
};

noop = () => {};

render () {
const { handleChange } = this;
const { handleChange, noop } = this;
const { settings, item, id, inputProps, options, children, dependsOn, dependsOnNot, placeholder, disabled } = this.props;
let enabled = !disabled;

Expand All @@ -60,8 +62,8 @@ export default class LocalSettingsPageItem extends PureComponent {
name={id}
id={optionId}
value={opt.value}
onBlur={handleChange}
onChange={handleChange}
onClick={handleChange}
onChange={noop}
checked={currentValue === opt.value}
disabled={!enabled}
{...inputProps}
Expand Down

0 comments on commit dc2aa6a

Please sign in to comment.