Skip to content

Allow assigning IDs to Nuxt UI Tab panels for scroll targeting #3868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cannap opened this issue Apr 12, 2025 · 0 comments
Open

Allow assigning IDs to Nuxt UI Tab panels for scroll targeting #3868

cannap opened this issue Apr 12, 2025 · 0 comments
Labels
enhancement New feature or request triage

Comments

@cannap
Copy link

cannap commented Apr 12, 2025

Description

How can I assign an ID to a tab so that I can scroll directly to it?
Currently, I’m working around this by giving the div inside the slot (i.e. the tab content) an ID. When the tab is opened, I scroll to that ID manually.

<template>
  <UAccordion
    v-model="currentOpen"
    :ui="accordionStyle"
    :items="items"
  >
    <template #component="{ item }">
      <component
        :is="getComponent((item as CustomAccordionItem).componentName)"
        :id="(item as CustomAccordionItem).sectionKey"
        :section-key="(item as CustomAccordionItem).sectionKey"
        @section-mounted="sectionMounted"
      />
    </template>
  </UAccordion>
</template>

did i miss something?

Additional context

No response

@cannap cannap added enhancement New feature or request triage labels Apr 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage
Projects
None yet
Development

No branches or pull requests

1 participant