mirror of
https://github.com/modrinth/code.git
synced 2026-09-02 13:05:50 +00:00
fix: button trigger placeholder text styles
This commit is contained in:
@@ -76,8 +76,14 @@
|
|||||||
v-if="showIconInSelected && selectedOption?.icon"
|
v-if="showIconInSelected && selectedOption?.icon"
|
||||||
class="h-5 w-5 shrink-0"
|
class="h-5 w-5 shrink-0"
|
||||||
/>
|
/>
|
||||||
<span class="min-w-0 truncate text-primary font-semibold leading-tight">
|
<span
|
||||||
<slot name="selected" :label="triggerText">{{ triggerText }}</slot>
|
v-if="selectedOption"
|
||||||
|
class="min-w-0 truncate text-primary font-semibold leading-tight"
|
||||||
|
>
|
||||||
|
<slot name="selected" :label="selectedTriggerText">{{ selectedTriggerText }}</slot>
|
||||||
|
</span>
|
||||||
|
<span v-else class="min-w-0 truncate text-secondary opacity-70 font-medium leading-tight">
|
||||||
|
{{ placeholderText }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex shrink-0 items-center gap-1">
|
<div class="flex shrink-0 items-center gap-1">
|
||||||
@@ -391,9 +397,13 @@ const searchableInputClass = computed(() => {
|
|||||||
return parts.join(' ')
|
return parts.join(' ')
|
||||||
})
|
})
|
||||||
|
|
||||||
const triggerText = computed(() => {
|
const selectedTriggerText = computed(() => {
|
||||||
|
if (props.displayValue !== undefined) return props.displayValue
|
||||||
|
return selectedOption.value?.label ?? ''
|
||||||
|
})
|
||||||
|
|
||||||
|
const placeholderText = computed(() => {
|
||||||
if (props.displayValue !== undefined) return props.displayValue
|
if (props.displayValue !== undefined) return props.displayValue
|
||||||
if (selectedOption.value) return selectedOption.value.label
|
|
||||||
return props.placeholder
|
return props.placeholder
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user