Skip to content

Commit

Permalink
Merge pull request #4734 from nextcloud-libraries/fix/nc-timezone-pic…
Browse files Browse the repository at this point in the history
…ker-allow-uid

fix(NcTimezonePicker): Allow to set ID of inner select component
  • Loading branch information
Pytal committed Nov 1, 2023
2 parents e13ede7 + 847f6aa commit 6d55089
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/NcTimezonePicker/NcTimezonePicker.vue
Original file line number Diff line number Diff line change
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 6d55089

Please sign in to comment.