Skip to content

Commit 2e8d78b

Browse files
authored
Merge pull request #3 from kristof-mattei/label-for
chore: link label to select
2 parents 40a1f23 + 9073f26 commit 2e8d78b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/RechartsDevtools.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export const RechartsDevtools = () => {
5252
const portalId = contextId ?? RECHARTS_DEVTOOLS_PORTAL_ID;
5353
const { selectedInspectorId, setSelectedInspectorId, selectedInspector } = useSelectedInspector();
5454
const [container, setContainer] = React.useState<HTMLElement | null>(null);
55+
const selectId = React.useId();
5556

5657
React.useEffect(() => {
5758
const el = document.getElementById(portalId);
@@ -92,8 +93,9 @@ export const RechartsDevtools = () => {
9293
<div
9394
style={{ display: 'flex', alignItems: 'center', marginBottom: '4px', gap: '8px' }}
9495
>
95-
<label>Inspect Hook:</label>
96+
<label htmlFor={selectId}>Inspect Hook:</label>
9697
<select
98+
id={selectId}
9799
value={selectedInspectorId}
98100
onChange={(e) => setSelectedInspectorId(e.target.value as InspectorKey)}
99101
style={{ padding: '4px' }}

0 commit comments

Comments
 (0)