mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-27 02:24:03 -05:00
Fix keyboard navigation changing settings in App settings
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 <plastikmensch@users.noreply.github.com>
This commit is contained in:
parent
3b49b5a880
commit
dc2aa6ae82
@ -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;
|
||||
|
||||
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user