File tree Expand file tree Collapse file tree
2nd-gen/packages/swc/patterns/conversational-ai/prompt-field Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -702,10 +702,7 @@ export class PromptField extends SpectrumElement {
702702 return ;
703703 }
704704
705- // Scroll to the tile that starts the next/previous page rather than a
706- // blind clientWidth: near the end only one item may remain, and a full
707- // page-width would overshoot and then snap back. scrollIntoView lands on
708- // the tile's snap point directly and clamps to the content edge.
705+ // Scroll the page-start tile into view: snap-aligned, clamps at the edge.
709706 const scrollRect = scrollEl . getBoundingClientRect ( ) ;
710707 const pageStart = this . _isRtl ( )
711708 ? scrollRect . right - direction * scrollEl . clientWidth
Original file line number Diff line number Diff line change 217217 overflow-y : hidden;
218218 scroll-behavior : smooth;
219219
220- /* proximity, not mandatory: the has-scroll-prev/next classes change
221- * scroll-padding-inline when a chevron appears, and mandatory would force an
222- * instant re-snap to the new alignment (a visible yank). Paging still lands
223- * aligned because it scrollIntoViews the target tile. */
220+ /* proximity avoids a forced re-snap when the chevrons change scroll-padding */
224221 scroll-snap-type : inline proximity;
225222 scroll-padding-inline : token ("spacing-75" );
226223 scrollbar-color : token ("gray-400" ) transparent;
Original file line number Diff line number Diff line change @@ -348,8 +348,7 @@ export const ArtifactScrollPaginationTest: Story = {
348348 const tiles = scrollEl
349349 ?. querySelector ( 'slot' )
350350 ?. assignedElements ( { flatten : true } ) as HTMLElement [ ] | undefined ;
351- // proximity is the default strictness, so it is omitted from the
352- // computed value ('inline'); only mandatory would be serialized.
351+ // Computed scroll-snap-type omits proximity (the default); only mandatory serializes.
353352 const snapType = getComputedStyle ( scrollEl ! ) . scrollSnapType ;
354353 expect ( snapType ) . toContain ( 'inline' ) ;
355354 expect ( snapType ) . not . toContain ( 'mandatory' ) ;
You can’t perform that action at this time.
0 commit comments