SelectButton in PrimeVue 4.x can always be deselected. #3099
Replies: 4 comments
-
Hey @BrutalSoloH could you share the config.cardOrder value? |
Beta Was this translation helpful? Give feedback.
-
It's defined like this.. export enum CardOrder {
alternating = 1,
ranksuit = 2,
};
export class Config {
cardOrder = CardOrder.alternating;
};
const config = reactive(new Config()) as Config;
app.provide('config', config)
....
const config = inject<Config>("config")!
const optCardOrder = computed(() => [{
label: "Alternating",
value: CardOrder.alternating
}, {
label: "By Rank,
value: CardOrder.ranksuit
}]);
....
<SelectButton v-model="config.cardOrder" :options="optCardOrder" option-label="label"
option-value="value" :allow-empty="false" />
If I deselect the option (so nothing is selected anymore) then the value of config.cardOrder remains the value of the last selected option. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
The value is expected, but visually none of the buttons are selected, so the user doesn’t know what value is selected. |
Beta Was this translation helpful? Give feedback.
-
I have this code:
But still I can deselect all options while allowEmpty = false. What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions