From fd91ce5553aa04e6105656f9f77dcd20e20199c5 Mon Sep 17 00:00:00 2001 From: Sergiu Cazac Date: Thu, 19 Dec 2024 15:27:59 +0200 Subject: [PATCH] feat(SelectItem): fix situation when initial event is prevented by the parent --- packages/core/src/Select/SelectItem.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/core/src/Select/SelectItem.vue b/packages/core/src/Select/SelectItem.vue index 5dfc97ba4..eee5c7673 100644 --- a/packages/core/src/Select/SelectItem.vue +++ b/packages/core/src/Select/SelectItem.vue @@ -68,7 +68,10 @@ const textId = useId(undefined, 'reka-select-item-text') const SELECT_SELECT = 'select.select' -function handleSelectCustomEvent(ev: PointerEvent | KeyboardEvent) { +async function handleSelectCustomEvent(ev: PointerEvent | KeyboardEvent) { + if (ev.defaultPrevented) + return + const eventDetail = { originalEvent: ev, value: props.value as T } handleAndDispatchCustomEvent(SELECT_SELECT, handleSelect, eventDetail) }