Skip to content
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

Virtual Scroller: Event first and last behave differently #7095

Open
1 of 4 tasks
Mettbrot opened this issue Jan 14, 2025 · 1 comment
Open
1 of 4 tasks

Virtual Scroller: Event first and last behave differently #7095

Mettbrot opened this issue Jan 14, 2025 · 1 comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@Mettbrot
Copy link

Describe the bug

In the virtual scroller event, first is counted zero based, while last is counted 1 based.

Pull Request Link

No response

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/f5xvgjnv?file=src%2FApp.vue

Environment

Stackblitz Environment

Vue version

3.2.45

PrimeVue version

4.2.5

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  • In the beginning virtual scroller is at the top: first = 0, last = 8
  • Scroll to the bottom
  • first is 9994, last is 10000. But the latest item has the (zero based) number 9999

See this screenshot:

Image

Expected behavior

The value of last in the event should also be counted zero based and should point to 9999 in the stackblitz example.

@Mettbrot Mettbrot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 14, 2025
@Mettbrot
Copy link
Author

The naming first and last suggests that the same counting method is used. If this is not the case (and this is not a bug), last should maybe be renamed to size or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant