fix(ui): fix NaN input in Pagination#1794
Open
guoda-puidokaite wants to merge 3 commits into
Open
Conversation
Signed-off-by: I531348 <guoda.puidokaite@sap.com>
🦋 Changeset detectedLatest commit: c4c663d The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
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 |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an input-edge-case in the Pagination component (input variant) so that non-numeric values no longer result in NaN being shown, aligning behavior with the expectation to fall back to the last available page.
Changes:
- Clamp non-numeric (
NaN) input values tocontrolTotalPage(last page) in the input handler. - Add a regression test covering symbol/non-numeric input behavior.
- Add a changeset to release the fix as a patch for
@cloudoperators/juno-ui-components.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/ui-components/src/components/Pagination/Pagination.component.tsx | Treats NaN input as invalid and falls back to the last page (controlTotalPage). |
| packages/ui-components/src/components/Pagination/Pagination.test.tsx | Adds a regression test for non-numeric input handling in the input variant. |
| .changeset/eleven-buses-bet.md | Declares a patch release note for the Pagination NaN input fix. |
Contributor
|
Signed-off-by: I531348 <guoda.puidokaite@sap.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When NaN input is entered, instead of printing
NaN, the last available page is defaulted to.Related Issues
Closes #1793
Checklist
PR Manifesto
Review the PR Manifesto for best practises.