fix: make widget toggle cards clickable
This commit is contained in:
1 parent
93d160aebd
commit
14cc3e8a44
2 files changed
+12
-1
No files matched your search
@@ -102,6 +102,7 @@
|
|||||||
|
|
||||||
.switchOption {
|
.switchOption {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
cursor: pointer;
|
||||||
height: 4.5rem;
|
height: 4.5rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0.625rem 0.75rem;
|
padding: 0.625rem 0.75rem;
|
||||||
|
|||||||
@@ -570,7 +570,17 @@ export const WidgetEditModal = createModal<WidgetEditModalProps<WidgetKind>>(({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box key={key} className={classes.switchOption} data-option-type={value.type}>
|
<Box
|
||||||
|
key={key}
|
||||||
|
className={classes.switchOption}
|
||||||
|
data-option-type={value.type}
|
||||||
|
onClick={(event) => {
|
||||||
|
const target = event.target;
|
||||||
|
if (target instanceof Element && target.closest("label, input")) return;
|
||||||
|
const input = event.currentTarget.querySelector<HTMLInputElement>("input[type=checkbox]");
|
||||||
|
if (!input?.disabled) input?.click();
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Input
|
<Input
|
||||||
kind={innerProps.kind}
|
kind={innerProps.kind}
|
||||||
property={key}
|
property={key}
|
||||||
|
|||||||
Reference in new issue
Block a user