Skip to content

Commit 1af095d

Browse files
committed
Disable switch while loading
1 parent 2ec8916 commit 1af095d

File tree

1 file changed

+9
-1
lines changed
  • airbyte-webapp/src/components/base/Switch

1 file changed

+9
-1
lines changed

airbyte-webapp/src/components/base/Switch/Switch.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,17 @@ export const Switch: React.FC<SwitchProps> = ({ loading, small, checked, value,
1717
[styles.small]: small,
1818
[styles.loading]: loading,
1919
});
20+
2021
return (
2122
<label onClick={(event: React.SyntheticEvent) => event.stopPropagation()} className={labelStyle}>
22-
<input {...props} className={styles.switchInput} type="checkbox" value={value} checked={checked || !!value} />
23+
<input
24+
{...props}
25+
className={styles.switchInput}
26+
type="checkbox"
27+
value={value}
28+
disabled={loading || props.disabled}
29+
checked={checked || !!value}
30+
/>
2331
<span className={spanStyle} />
2432
</label>
2533
);

0 commit comments

Comments
 (0)