Skip to content

Commit

Permalink
added smooth scroll bahavior to popover-container
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeByLudwig authored and omgitsjan committed Mar 17, 2024
1 parent 2486859 commit 3257cd5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const loading = ref(false)
const isOpen = ref(false)
const currentLink = ref('')
const open = ref(false)
const popover = ref<null | HTMLElement>(null)
const formState = reactive({
search: '',
Expand Down Expand Up @@ -78,6 +79,10 @@ function toggleTldPicker() {
return a > b ? 1 : -1
})
setTimeout(() => {
popover.value?.scrollIntoView({ behavior: 'smooth' })
}, 200)
search.value = ''
}
Expand All @@ -91,7 +96,10 @@ async function fetchTLDs(input: any = null): Promise<string[]> {
)
if (fetchError.value || !data.value) {
console.error('Failed to fetch TLDs, using default TLDs:', fetchError.value)
console.error(
t('notifications.generalError', { returnObjects: true }),
fetchError.value
)
return defaultTlds
}
Expand Down Expand Up @@ -281,6 +289,7 @@ function openLinkModal(domain: string) {

<template #panel>
<div
ref="popover"
class="w-full border border-[rgb(var(--color-primary-400))] rounded"
style="background-color: rgb(var(--ui-background))"
>
Expand All @@ -296,6 +305,7 @@ function openLinkModal(domain: string) {
})
"
:autofocus="true"
autofocusDelay="400"
>
</UInput>

Expand Down

0 comments on commit 3257cd5

Please sign in to comment.