Ion-Segment ScrollIntoView behavior 'smooth' not working after upgrading from ionic 5 to 6

Hello,

I’m encountering a problem with the document.scrollIntoView() behaviour after upgrading from Ionic 5 to 6.

I noticed that my segments weren’t scrolling into the view anymore so I decided to remove the “behavior: ‘smooth’” property and that seemed to fix the problem.

This was the original code:

document.getElementById('segment-button-' + this.selectedSegment).scrollIntoView({
         behavior: 'smooth',
         block: 'center',
         inline: 'center'
      });

With behaviour smooth:
behavior smooth

Without behaviour smooth:
withour behavior smooth

Does anyone know a solution to this problem because it ruins the user experience of my app.

Not sure why it is needed, but I fixed it by setting a timeout of 50ms.