diff --git a/front/src/components/ui/Input.vue b/front/src/components/ui/Input.vue index 654c308f4..2c99f69cd 100644 --- a/front/src/components/ui/Input.vue +++ b/front/src/components/ui/Input.vue @@ -117,7 +117,7 @@ const model = defineModel({ required: true }) class="input-right show-password" title="toggle visibility" @click="showPassword = !showPassword" - @blur="(e) => { console.log(e.relatedTarget); if (e.relatedTarget && 'value' in e.relatedTarget && e.relatedTarget.value === model) showPassword = showPassword; else showPassword = false; }" + @blur="(e) => { if (e.relatedTarget && 'value' in e.relatedTarget && e.relatedTarget.value === model) showPassword = showPassword; else showPassword = false; }" > diff --git a/front/src/components/ui/Layout.vue b/front/src/components/ui/Layout.vue index deb57703e..22ecb052f 100644 --- a/front/src/components/ui/Layout.vue +++ b/front/src/components/ui/Layout.vue @@ -19,7 +19,7 @@ const columnWidth = props.columnWidth ?? '46px' const maybeGap = Object.entries(props).find( ([key, value]) => value === true && key.startsWith('gap')) -const gapWidth = maybeGap ? `${maybeGap[0].replace('gap', '')}px` : '32px' +const gapWidth = maybeGap ? `${maybeGap[0].replace('gap', '').replace('-', '')}px` : '32px' const attributes = computed(() => ({ ...color(props)(width(props)()), diff --git a/front/src/components/ui/Popover.vue b/front/src/components/ui/Popover.vue index 21cf03853..f345f6042 100644 --- a/front/src/components/ui/Popover.vue +++ b/front/src/components/ui/Popover.vue @@ -12,7 +12,7 @@ import { type ColorProps, type DefaultProps, type RaisedProps, color } from '~/c */ -const open = defineModel({ default: false }) +const isOpen = defineModel({ default: false }) const { positioning = 'vertical', ...colorProps } = defineProps<{ positioning?:'horizontal' | 'vertical' @@ -27,13 +27,13 @@ const inSlot = ref() const mobileClickOutside = (event: MouseEvent) => { const inPopover = !!(event.target as HTMLElement).closest('.funkwhale.popover') if (isMobile.value && !inPopover) { - open.value = false + isOpen.value = false } } onClickOutside(popover, async (event) => { const inPopover = !!(event.target as HTMLElement).closest('.funkwhale.popover') if (!isMobile.value && !inPopover) { - open.value = false + isOpen.value = false } }, { ignore: [slot] }) @@ -44,7 +44,7 @@ const { width: popoverWidth, height: popoverHeight } = useElementBounding(popove windowScroll: false }) -whenever(open, update, { immediate: true }) +whenever(isOpen, update, { immediate: true }) const { width: screenWidth, height: screenHeight } = useScreenSize() @@ -93,9 +93,9 @@ if (!stack) { provide(POPOVER_INJECTION_KEY, stack = shallowReactive([])) } -stack.push(open) +stack.push(isOpen) onScopeDispose(() => { - stack?.splice(stack.indexOf(open), 1) + stack?.splice(stack.indexOf(isOpen), 1) }) // Provide context for child items @@ -107,14 +107,14 @@ provide(POPOVER_CONTEXT_INJECTION_KEY, { // Closing const closeChild = () => { - const ref = stack?.[stack.indexOf(open) + 1] + const ref = stack?.[stack.indexOf(isOpen) + 1] if (!ref) return ref.value = false } // Recursively close popover tree -watch(open, (isOpen) => { +watch(isOpen, (isOpen) => { if (isOpen) return closeChild() }) @@ -128,15 +128,15 @@ watch(open, (isOpen) => { >
('internal:id') +const emit = defineEmits<{ setId: [value: number] }>() const { parentPopoverContext, to } = defineProps<{ parentPopoverContext?: PopoverContext; @@ -18,7 +18,7 @@ const { items, hoveredItem } = parentPopoverContext ?? inject(POPOVER_CONTEXT_IN }) const id = items.value++ -setId(id) +emit('setId', id)