primefaces / primefaces/primereact

Paginator: JumpToPage on paginator triggers twice on double digit input

Open
#7,060 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Discussion
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

I'm working on getting our app to have a jump to page feature. The current issue is that it goes to page 1 and then page 12 when we try to move to a page with two digits (for example, 12). Thus, two API calls are being made.

Reproducer

https://stackblitz.com/edit/j1ammf?file=src%2FApp.jsx

System Information

System:

    OS: Windows 11 10.0.22621
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 14.16 GB / 31.74 GB
  Binaries:
    Node: 20.12.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.86)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    primereact: ^10.7.0 => 10.6.6 
    react: ^18.2.0 => 18.2.0
Steps to reproduce the behavior
  1. type 2 in the input box
  2. type 12 in the input box
Expected behavior

The page should change to 12 directly from 2 instead of going to 1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproducer and the Paginator JumpToPage input behavior. Reproduce the sequence of entering 2 and then 12, then trace the resulting page changes and API calls. Done means entering a two-digit page changes directly to that page without first navigating to page 1.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.