Skip to content

Commit

Permalink
fix(NcTimezonePicker): Allow to set ID of inner select element to be …
Browse files Browse the repository at this point in the history
…able to reference it for labels

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Nov 1, 2023
1 parent e13ede7 commit 847f6aa
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/NcTimezonePicker/NcTimezonePicker.vue
Expand Up @@ -41,7 +41,8 @@ export default {
</docs>

<template>
<NcSelect :value="selectedTimezone"
<NcSelect :uid="uid"
:value="selectedTimezone"
:options="options"
:multiple="false"
:clearable="false"
Expand All @@ -58,6 +59,7 @@ import {
getSortedTimezoneList,
} from './timezone.js'
import getTimezoneManager from './timezoneDataProviderService.js'
import GenRandomId from '../../utils/GenRandomId.js'
import NcSelect from '../NcSelect/index.js'
import { t } from '../../l10n.js'
Expand All @@ -81,6 +83,13 @@ export default {
type: String,
default: 'floating',
},
/**
* ID of the inner vue-select element, can be used for labels like: `vs-${uid}__combobox`
*/
uid: {
type: [String, Number],
default: () => `tz-${GenRandomId(5)}`,
},
},
emits: ['input'],
computed: {
Expand Down

0 comments on commit 847f6aa

Please sign in to comment.