sadpandajoe commented on code in PR #44452:
URL: https://github.com/apache/superset/pull/44452#discussion_r4227043698
##########
superset-frontend/src/explore/components/controls/CheckboxControl.tsx:
##########
@@ -50,24 +58,77 @@ const CheckBoxControlWrapper = styled.div`
export default function CheckboxControl({
value = false,
label,
+ disabled = false,
+ disabledReason,
+ resetLabel,
onChange = () => {},
...restProps
}: CheckboxControlProps): JSX.Element {
+ const explanationId = useId();
+ const generatedCheckboxId = useId();
+ const checkboxId = restProps.name || generatedCheckboxId;
Review Comment:
Every `CheckboxControl` that passes a `name` now renders its input with
`id={name}` (line 69/78), but column-config popovers reuse the same key (e.g.
`showCellBars`) for each column and keep their DOM after closing. With two
columns' popovers opened in turn, both inputs get `id="showCellBars"`, so
column B's label `htmlFor` and the
`document.getElementById(checkboxId)?.focus()` lookup at line 117 resolve to
column A's input, and a click in the label area can toggle A's setting instead
of B's. Should the input/label id be an instance-unique value (e.g. the
generated `useId()` value, optionally prefixed with the name) rather than the
shared control name?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]