Skip to content

Commit 751ce5f

Browse files
author
Tanner Reits
committed
fix(segment): scroll active button into view
1 parent d55ce49 commit 751ce5f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/components/segment/segment.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ export class Segment implements ComponentInterface {
327327

328328
// Remove the transform to slide the indicator back to the button clicked
329329
currentIndicator.style.setProperty('transform', '');
330+
331+
current.scrollIntoView();
330332
});
331333

332334
this.value = current.value;
@@ -592,6 +594,7 @@ export class Segment implements ComponentInterface {
592594

593595
if (this.segmentViewEl) {
594596
this.updateSegmentView();
597+
current.scrollIntoView();
595598
} else if (this.scrollable || !this.swipeGesture) {
596599
if (previous) {
597600
this.checkButton(previous, current);

0 commit comments

Comments
 (0)