Skip to content

fix(Pagination): prevent NaN when page input is cleared - #1157

Open
fallintoplace wants to merge 1 commit into
ClickHouse:mainfrom
fallintoplace:fix/pagination-empty-page-input
Open

fix(Pagination): prevent NaN when page input is cleared#1157
fallintoplace wants to merge 1 commit into
ClickHouse:mainfrom
fallintoplace:fix/pagination-empty-page-input

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 30, 2026

Copy link
Copy Markdown

Why?

Clearing the page input makes parseInt return NaN. Since comparisons with NaN are always false, the existing minimum and maximum checks allow it through to onChange, where consumers can store an invalid page number.

What changed?

  • Reject NaN before applying the existing range checks
  • Add a regression test that clears the input and verifies onChange is not called
  • Add a patch changeset

Valid page numbers keep their current behavior, including truncating decimal input.

Validation

  • yarn test --run
  • yarn typecheck
  • yarn lint
  • yarn build

@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1c8b465

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clickhouse/click-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@fallintoplace fallintoplace changed the title fix(Pagination): ignore empty page input fix(Pagination): ignore cleared page input Jul 30, 2026
@fallintoplace
fallintoplace force-pushed the fix/pagination-empty-page-input branch from efb221a to 1c8b465 Compare July 30, 2026 17:58
@fallintoplace fallintoplace changed the title fix(Pagination): ignore cleared page input fix(Pagination): prevent NaN when page input is cleared Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant