fix(carousel): correct page count when rendered inside a Portal/Dialog#2997
Merged
segunadebayo merged 2 commits intomainfrom Feb 28, 2026
Merged
fix(carousel): correct page count when rendered inside a Portal/Dialog#2997segunadebayo merged 2 commits intomainfrom
segunadebayo merged 2 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 06f6461 The changes in this PR will be included in the next version bump. This PR includes changesets to release 84 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…x page count in Portal/Dialog Co-authored-by: anubra266 <30869823+anubra266@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix incorrect page count in carousel rendered inside dialog
fix(carousel): correct page count when rendered inside a Portal/Dialog
Feb 28, 2026
Merged
isBatak
pushed a commit
to isBatak/zag
that referenced
this pull request
Feb 28, 2026
chakra-ui#2997) * Initial plan * fix(carousel): observe item-group container with ResizeObserver to fix page count in Portal/Dialog Co-authored-by: anubra266 <30869823+anubra266@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: anubra266 <30869823+anubra266@users.noreply.github.com>
segunadebayo
added a commit
that referenced
this pull request
Mar 1, 2026
* feat: implement segmets getter * feat: wip on segments * feat: implement placeholder * feat: fill in segments on value select * feat: working on key events * feat: replace local date formatter with global reference * chore: fix comments * feat: complete segment value increment/decrement functionality * chore: some fixes * feat: implement placeholderValue and reset segments on value clear * feat: fix markValid * feat: wip on backspace * chore: remove extra pages * feat: wip on segment delete * chore: remove console log * refactor(date-picker): simplify key handling and segment validation logic * feat: initial segment input support * feat: improve focus management * chore: updates * feat: fix input issures * feat: clear placeholder data * feat: implement home and end key actions * feat: prevent default behavior for paste events in date picker input * chore: export missing types * feat: add placeholder display to date picker outputs and introduce datePickerWithSegmentsControls * refactor: dedidcated package * chore: update deps * docs: add changeset * revert: remove date-picker machine and example changes * feat(date-field): integrate live region for segment announcements and add segment label utility * test: fix e2e * chore: compose * chore: :granularity display * fix: backspace delete * chore: rename to date-input * feat(-use-controls): add date support * chore: add px ui script * feat: add placeholder value display to date field component * fix: rename dateField to dateInput * feat: add test ArrowUp value starts from placeholder date * feat: use el.fill instead of el.evaluate( * feat: improve test * feat: fix moving to next range input * fix: improve "[input] Backspace clears day after clearing year" test * fix: typo * fix: implement clearValueIfAllSegmentsInvalid that fixes the flaky test * feat: add granularity tests * fix(date-input): prevent crash and stale segments when backspacing end date to empty * fix(date-input): maek ArrowUp/Down on empty segments now starts from placeholderValue prop * fix(date-input): use machine state for active segment in clearSegmentValue * feat: wip on cycle fixes * refactor(date-input): replace editingValue + validSegments with IncompleteDate * chore: show displayValues in input range * chore: update tests * chore: update tests * Version Packages (#2972) ci(changesets): version packages Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * chore: add `data-placeholder-shown` to cascade select (#2975) * fix(cascade-select): rename `data-focused` to `data-focus` for consistency (#2976) * fix(cascade-select): rename `data-focused` to `data-focus` for consistency * chore: update datepicker * feat(date-picker): add non-Gregorian calendar support * fix: docs tokens * fix(combobox): return correct items in onValueChange for controlled usage (#2980) * Initial plan * fix: combobox onValueChange returns empty items array with controlled value Co-authored-by: anubra266 <30869823+anubra266@users.noreply.github.com> * test(combobox): add e2e tests for onValueChange items callback Co-authored-by: anubra266 <30869823+anubra266@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: anubra266 <30869823+anubra266@users.noreply.github.com> * chore(deps): lock file maintenance (#2982) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: update pnpm * chore: refactor eslint * fix: toast types * chore: select example * chore: mv example * build: prefer per-file build * fix: popover sync layer-index * fix(vanilla): merge props (#2984) * fix(vanilla): styles prop with mergeProps * chore: changeset * chore(deps): update all non-major dependencies Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(*): support nested states (#2985) * Initial plan * feat: support nested states Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com> * docs(core): document nested states Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com> * docs(core): remove unsupported features Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com> * test: isolate nested state specs Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com> * test: strengthen nested coverage Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com> * chore: add changeset for nested states Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com> * refactor: code * fix: typecheck and e2e * chore: add example * refactor: update * test: refactoe * test: setup vue tests * test: setup svelte * test: enrich * test: even more * refactor: use new nested state --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.com> Co-authored-by: Segun Adebayo <joseshegs@gmail.com> * docs: commuity page * fix(colorpicker): nested state regression * docs: next changelog * Version Packages (#2977) ci(changesets): version packages Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * docs: polish * docs: update agents * fix: color picker regression * fix: packages/docs * Version Packages (#2990) ci(changesets): version packages Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * docs: next changelog * fix: cjs build issues * Version Packages (#2991) ci(changesets): version packages Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * docs: changelog * chore(deps): update dependency svelte to v5.53.5 [security] (#2992) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(carousel): improve reliability * fix(carousel): correct page count when rendered inside a Portal/Dialog (#2997) * Initial plan * fix(carousel): observe item-group container with ResizeObserver to fix page count in Portal/Dialog Co-authored-by: anubra266 <30869823+anubra266@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: anubra266 <30869823+anubra266@users.noreply.github.com> * chore: use transformValue in controlls * chore: fix some tests * feat(date-input): convert placeholder to CalendarDateTime for time granularities * feat: update docs jsons * feat(date-input): add BC era support and shouldForceLeadingZeros prop * feat(date-input): add shouldForceLeadingZeros control and E2E tests * fix(date-input): preserve entered segments when placeholderValue or granularity changes * fix(date-input): preserve entered segments when granularity or placeholderValue changes * perf(date-input): memoize segments computation * docs(date-input): add component documentation and snippets * feat(website): implement date-input showcase component * feat(date-input): add groupCount API and improve reactivity --------- Co-authored-by: Segun Adebayo <joseshegs@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Abraham <anubra266@gmail.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: anubra266 <30869823+anubra266@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Joost <81250358+jramke@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: segunadebayo <6916170+segunadebayo@users.noreply.github.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.
Carousel inside a Dialog/Portal computes snap points before the portal's DOM layout is complete, resulting in incorrect
pageSnapPointsand unreachable slides (e.g., 10 pages calculated for 11 slides).📝 Description
trackSlideResizeonly observed individual slide elements viaResizeObserver. When mounted inside a Portal, the container (item-group) resizes from zero to its actual dimensions as the dialog opens — but that resize was never observed, soSNAP.REFRESHwas never triggered with correct layout data.⛳️ Current behavior (updates)
SNAP.REFRESH(which recalculatespageSnapPoints) is only triggered by slide-level resize events. Container-level resizes — which happen when a Portal/Dialog completes layout — are silently ignored.🚀 New behavior
The
item-groupcontainer is now also observed byResizeObserver. Any container resize (e.g., dialog opening, portal becoming visible) triggersSNAP.REFRESH, ensuring snap points are always computed from accurate layout dimensions.💣 Is this a breaking change (Yes/No):
No
📝 Additional Information
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.