Skip to content

Commit 27fa5d7

Browse files
committed
fix(base-input): input id isn't unique if same label is used twice
1 parent 0265d49 commit 27fa5d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/anu-vue/src/components/base-input/ABaseInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const ABaseInput = defineComponent({
2121
},
2222
setup(props, { attrs, slots, expose }) {
2323
const iconTransition = 'transition duration-150 ease -in'
24-
const elementId = attrs.id || props.label ? `a-input-${attrs.id || props.label}` : undefined
24+
const elementId = attrs.id || props.label ? `a-input-${attrs.id || props.label}-${Math.random().toString(36).slice(2, 7)}` : undefined
2525

2626
const refRoot = ref()
2727
const refInputContainer = ref()

0 commit comments

Comments
 (0)