wip bsky client for the web & android
bbell.vt3e.cat
1diff --git a/src/components/UI/BasePopover.vue b/src/components/UI/BasePopover.vue
2index 89a50e1..1251ba2 100644
3--- a/src/components/UI/BasePopover.vue
4+++ b/src/components/UI/BasePopover.vue
5@@ -38,13 +38,30 @@ const emit = defineEmits<{
6 (e: 'close'): void
7 }>()
8
9-const unwrapToElement = (maybeEl: unknown): HTMLElement | null => {
10- if (!maybeEl) return null
11-
12+function unwrapToElement(maybeEl: unknown): HTMLElement | null {
13 if (maybeEl instanceof HTMLElement) return maybeEl
14- if (maybeEl.$el instanceof HTMLElement) return maybeEl.$el as HTMLElement
15- if (maybeEl.$el?.value instanceof HTMLElement) return maybeEl.$el.value as HTMLElement
16- if (maybeEl.value instanceof HTMLElement) return maybeEl.value as HTMLElement
17+
18+ if (maybeEl && typeof maybeEl === 'object') {
19+ const obj = maybeEl as Record<string, unknown>
20+
21+ if ('$el' in obj) {
22+ const $el = (obj as { $el?: unknown }).$el
23+ if ($el instanceof HTMLElement) return $el
24+ if ($el && typeof $el === 'object' && 'value' in ($el as Record<string, unknown>)) {
25+ const v = ($el as { value?: unknown }).value
26+ if (v instanceof HTMLElement) return v
27+ }
28+ }
29+
30+ if ('value' in obj) {
31+ const v = (obj as { value?: unknown }).value
32+ if (v instanceof HTMLElement) return v
33+ if (v && typeof v === 'object' && '$el' in (v as Record<string, unknown>)) {
34+ const nested = (v as { $el?: unknown }).$el
35+ if (nested instanceof HTMLElement) return nested
36+ }
37+ }
38+ }
39
40 return null
41 }