From a2d570b7ad8b799b072ba6eb79d8fe4c6dd77cf0 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 30 Nov 2022 10:15:48 -0500 Subject: [PATCH] fix(segment): scrolling button into view is more consistent (#26369) resolves #26368 --- core/src/components/segment/segment.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/src/components/segment/segment.tsx b/core/src/components/segment/segment.tsx index 08cdc3e3f2..4a83c2fa33 100644 --- a/core/src/components/segment/segment.tsx +++ b/core/src/components/segment/segment.tsx @@ -101,6 +101,15 @@ export class Segment implements ComponentInterface { activeButton.scrollIntoView({ behavior: 'smooth', inline: 'center', + + /** + * Segment should scroll on the + * horizontal axis. `block: 'nearest'` + * ensures that the vertical axis + * does not scroll if the segment + * as a whole is already in view. + */ + block: 'nearest', }); } }