Skip to content

Commit 7c89da9

Browse files
(Input): add a fallback for an empty string
1 parent a86434e commit 7c89da9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/scripts/Input.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,10 @@ export const Input = createFC<InputProps, { isFormElement: boolean }>(
172172
const labelId = label ? `${prefix}-label-id` : undefined;
173173
const preAddonId = addonLeft ? `${prefix}-pre-addon-id` : undefined;
174174
const postAddonId = addonRight ? `${prefix}-post-addon-id` : undefined;
175-
const labelledBy = [labelId, preAddonId, postAddonId]
176-
.filter((id) => id !== undefined)
177-
.join(' ');
175+
const labelledBy =
176+
[labelId, preAddonId, postAddonId]
177+
.filter((id) => id !== undefined)
178+
.join(' ') || undefined;
178179

179180
const errorId = `${prefix}-error-id`;
180181

0 commit comments

Comments
 (0)