mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
fix(segment): scrolling button into view is more consistent (#26369)
resolves #26368
This commit is contained in:
@ -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',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user