Skip to content

DataTable: fixing tabindex initialization with initial selection set #8218

@ariccadonna

Description

@ariccadonna

Describe the bug

When using a DataTable and the selected model is initialized with an empty array the keyboard navigation is broken until a row is selected

Pull Request Link

#8217

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-3t1wqqex?file=src%2FApp.vue

Environment

PrimeVue

Vue version

3.5.21

PrimeVue version

4.4.1

Node version

22.14.0

Browser(s)

No response

Steps to reproduce the behavior

  1. Use DataTable and initialize the v-model of selection to an empty array
  2. Tab to the first row
  3. The Tab action skips the table

Expected behavior

By using the tab key the first row should be selected

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions