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