fix(segment): scrolling button into view is more consistent (#26369)

resolves #26368
This commit is contained in:
Liam DeBeasi
2022-11-30 10:15:48 -05:00
committed by GitHub
parent 88d327b6f7
commit a2d570b7ad

View File

@ -101,6 +101,15 @@ export class Segment implements ComponentInterface {
activeButton.scrollIntoView({ activeButton.scrollIntoView({
behavior: 'smooth', behavior: 'smooth',
inline: 'center', 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',
}); });
} }
} }