Skip to content

Commit

Permalink
Fix for enabled/disabled checkbox input.
Browse files Browse the repository at this point in the history
  • Loading branch information
zachwhelchel committed Oct 17, 2023
1 parent 76e70d1 commit 7f372de
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions packages/desktop-client/src/components/mobile/MobileForms.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,33 @@ export function TapField({
}

export function BooleanField({ checked, onUpdate, style, disabled = 'false' }) {
return (
<input
disabled={disabled}
type="checkbox"
checked={checked}
onChange={e => onUpdate(e.target.checked)}
className={`${css([
{
marginInline: styles.mobileEditingPadding,
},
style,
])}`}
/>
);
if (disabled === 'true') {
return (
<input
disabled="disabled"
type="checkbox"
checked={checked}
className={`${css([
{
marginInline: styles.mobileEditingPadding,
},
style,
])}`}
/>
);
} else {
return (
<input
type="checkbox"
checked={checked}
onChange={e => onUpdate(e.target.checked)}
className={`${css([
{
marginInline: styles.mobileEditingPadding,
},
style,
])}`}
/>
);
}
}

0 comments on commit 7f372de

Please sign in to comment.