Skip to content

Commit 5b75f14

Browse files
committed
fix(Combobox,Listbox): handle empty option groups and null element refs
1 parent c7caa27 commit 5b75f14

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/Combobox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const container = ref()
126126
const query = ref('')
127127
const inputRef = ref()
128128
const comboboxButton = ref()
129-
const optionsPanelWidth = computed(() => comboboxButton.value?.el.offsetWidth)
129+
const optionsPanelWidth = computed(() => comboboxButton.value?.el?.offsetWidth)
130130
131131
const selectInputValue = () => {
132132
if (inputRef.value) {

src/components/Listbox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const emit = defineEmits<{
8282
const attrs = useAttrs()
8383
8484
const listboxButton = ref()
85-
const optionsPanelWidth = computed(() => listboxButton.value?.el.offsetWidth)
85+
const optionsPanelWidth = computed(() => listboxButton.value?.el?.offsetWidth)
8686
8787
// hack together a tab-out behavior for the listbox
8888
const handleTab = (event: KeyboardEvent) => {

0 commit comments

Comments
 (0)