fix(accounts): isolate checkbox double clicks
This commit is contained in:
@@ -360,10 +360,11 @@ function AccountRow({
|
||||
<input
|
||||
aria-label={`${row.hoster} ${row.enabled ? "deaktivieren" : "aktivieren"}`}
|
||||
checked={row.enabled}
|
||||
disabled={busy}
|
||||
disabled={busy}
|
||||
onChange={(event) => actions.onToggleEnabled(row.id, event.target.checked)}
|
||||
onClick={(event) => event.stopPropagation()}
|
||||
type="checkbox"
|
||||
onClick={(event) => event.stopPropagation()}
|
||||
onDoubleClick={(event) => event.stopPropagation()}
|
||||
type="checkbox"
|
||||
/>
|
||||
</span>
|
||||
<span className="settings-account-hoster" role="cell" title={`${row.hoster} · ${row.mode}`}>
|
||||
|
||||
@@ -1063,6 +1063,7 @@ describe("account workspace", () => {
|
||||
row.props.onKeyDown({ key: "Enter", target: row, currentTarget: row, preventDefault: () => {} });
|
||||
row.props.onKeyDown({ key: " ", target: checkbox, currentTarget: row, preventDefault: () => {} });
|
||||
checkbox.props.onChange({ target: { checked: false } });
|
||||
checkbox.props.onDoubleClick({ stopPropagation: () => calls.push("checkbox-double-click-stopped") });
|
||||
row.props.onDoubleClick();
|
||||
actionButton.props.onClick({ stopPropagation: () => {}, currentTarget: { getBoundingClientRect: () => ({ right: 20, bottom: 30 }) } });
|
||||
actionButton.props.onDoubleClick({ stopPropagation: () => calls.push("action-double-click-stopped") });
|
||||
@@ -1072,6 +1073,7 @@ describe("account workspace", () => {
|
||||
`select:${rowId}:true`,
|
||||
`select:${rowId}:false`,
|
||||
`toggle:${rowId}:false`,
|
||||
"checkbox-double-click-stopped",
|
||||
`edit:${rowId}`,
|
||||
`context:${rowId}`,
|
||||
"action-double-click-stopped"
|
||||
|
||||
Reference in New Issue
Block a user