Skip to content

Commit 9d9e53b

Browse files
committed
feat: apply suggestions to selects
1 parent 651cdf1 commit 9d9e53b

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

app/components/Org/MembersPanel.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ watch(lastExecutionTime, () => {
467467
:label="$t('org.members.change_role_for', { name: member.name })"
468468
hidden-label
469469
:id="`role-${member.name}`"
470-
v-model="member.role"
470+
:model-value="member.role"
471471
:name="`role-${member.name}`"
472472
block
473473
size="sm"
@@ -477,12 +477,7 @@ watch(lastExecutionTime, () => {
477477
{ label: getRoleLabel('owner'), value: 'owner' },
478478
]"
479479
:value="member.role"
480-
@change="
481-
handleChangeRole(
482-
member.name,
483-
($event.target as HTMLSelectElement).value as 'developer' | 'admin' | 'owner',
484-
)
485-
"
480+
@update:modelValue="value => handleChangeRole(member.name, value as MemberRole)"
486481
/>
487482
<!-- Remove button -->
488483
<button

app/components/Package/ListToolbar.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,14 @@ const availableSortKeys = computed(() => {
7777
})
7878
7979
// Handle sort key change from dropdown
80-
function handleSortKeyChange(event: Event) {
81-
const target = event.target as HTMLSelectElement
82-
const newKey = target.value as SortKey
83-
const config = SORT_KEYS.find(k => k.key === newKey)
84-
const direction = config?.defaultDirection ?? 'desc'
85-
sortOption.value = buildSortOption(newKey, direction)
86-
}
80+
const sortKeyModel = computed<SortKey>({
81+
get: () => currentSort.value.key,
82+
set: newKey => {
83+
const config = SORT_KEYS.find(k => k.key === newKey)
84+
const direction = config?.defaultDirection ?? 'desc'
85+
sortOption.value = buildSortOption(newKey, direction)
86+
},
87+
})
8788
8889
// Toggle sort direction
8990
function handleToggleDirection() {
@@ -166,8 +167,7 @@ function getSortKeyLabelKey(key: SortKey): string {
166167
:label="$t('filters.sort.label')"
167168
hidden-label
168169
id="sort-select"
169-
v-model="currentSort.key"
170-
@change="handleSortKeyChange"
170+
v-model="sortKeyModel"
171171
:items="
172172
availableSortKeys.map(keyConfig => ({
173173
label: getSortKeyLabelKey(keyConfig.key),

app/pages/settings.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ const setLocale: typeof setNuxti18nLocale = locale => {
7878
{{ $t('settings.theme') }}
7979
</label>
8080
<SelectField
81-
:value="colorMode.preference"
8281
id="theme-select"
8382
v-model="colorMode.preference"
8483
block
@@ -222,7 +221,7 @@ const setLocale: typeof setNuxti18nLocale = locale => {
222221
id="language-select"
223222
:items="locales.map(loc => ({ label: loc.name ?? '', value: loc.code }))"
224223
v-model="locale"
225-
@change="setLocale(($event.target as HTMLSelectElement).value as typeof locale)"
224+
@update:modelValue="setLocale($event as typeof locale)"
226225
block
227226
size="sm"
228227
class="max-w-48"

0 commit comments

Comments
 (0)