Skip to content

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

Open
@cannap

Description

@cannap

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions