From bbafa8999fabfb443682ee827845197ea60c7cf6 Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Wed, 4 Oct 2023 13:46:02 +0200 Subject: [PATCH] fix(NcSelect): make uid truly uniq Signed-off-by: Grigorii K. Shartsev --- src/components/NcSelect/NcSelect.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/NcSelect/NcSelect.vue b/src/components/NcSelect/NcSelect.vue index 1a6ad4d2ff..4f3a115072 100644 --- a/src/components/NcSelect/NcSelect.vue +++ b/src/components/NcSelect/NcSelect.vue @@ -546,6 +546,8 @@ import NcLoadingIcon from '../NcLoadingIcon/index.js' import l10n from '../../mixins/l10n.js' +import GenRandomId from '../../utils/GenRandomId.js' + export default { name: 'NcSelect', @@ -801,6 +803,16 @@ export default { }, }, + /** + * A unique identifier used to generate IDs and DOM attributes. Must be unique for every instance of the component. + * + * @see https://vue-select.org/api/props.html#uid + */ + uid: { + type: String, + default: () => '-' + GenRandomId(), + }, + /** * When `appendToBody` is true, this sets the placement of the dropdown *