We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
labelId
label
1 parent 432a147 commit a86434eCopy full SHA for a86434e
src/scripts/Input.tsx
@@ -165,16 +165,13 @@ export const Input = createFC<InputProps, { isFormElement: boolean }>(
165
166
const prefix = useId();
167
168
- const labelId = `${prefix}-label-id`;
169
-
170
const rawTextId = id ?? `${prefix}-raw-text-id`;
171
const inputId = id ?? `${prefix}-input-id`;
172
const labelForId = readOnly ? rawTextId : inputId;
173
+ const labelId = label ? `${prefix}-label-id` : undefined;
174
const preAddonId = addonLeft ? `${prefix}-pre-addon-id` : undefined;
175
176
const postAddonId = addonRight ? `${prefix}-post-addon-id` : undefined;
177
178
const labelledBy = [labelId, preAddonId, postAddonId]
179
.filter((id) => id !== undefined)
180
.join(' ');
0 commit comments