Skip to content

Conversation

@baadhira
Copy link
Contributor

@baadhira baadhira commented Dec 19, 2025

Closes #20995

Fixes a bug where the cds-pagination-changed-current event was firing twice on a single page change.

Changelog

New

  • {{new thing}}

Changed

  • Refactored the updated lifecycle method in CDSPagination to manually synchronize internal state (start) and UI state (pagesSelect.value) without re-triggering the user-initiated change event.

Removed

  • Removed the redundant call to _handleUserInitiatedChangeStart inside the updated lifecycle when the page property changes.

Testing / Reviewing

  • Open the Pagination component in Storybook (Web Components).
  • Go to the Actions panel at the bottom.
  • Click the Next or Previous arrow icons once.
  • Verification: Observe that cds-pagination-changed-current is logged exactly once.
  • Change the page using the dropdown menu.
  • Verification: Observe the event is logged exactly once and the UI remains in sync.
  • Run unit tests: yarn test --path components/pagination (Verified: 815 passed).

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • ] Reviewed every line of the diff
  • Updated documentation and storybook examples
  • Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

@baadhira baadhira requested a review from a team as a code owner December 19, 2025 06:44
@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 2793bb8
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/6948e10f328f7b0008703db5
😎 Deploy Preview https://deploy-preview-21206--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2793bb8
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/6948e10fd8069d0008b0460e
😎 Deploy Preview https://deploy-preview-21206--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 19, 2025

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 2793bb8
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/6948e10f59132c00082796eb
😎 Deploy Preview https://deploy-preview-21206--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

[Bug]: Pagination fires cds-pagination-changed-current event twice

1 participant