Changing inline option to nearest would not cause a scroll on the horizontal axis when opening the panel. Unless there is a reason why it uses start that I am unsure about.
highlightItem.scrollIntoView({ block: 'nearest', inline: nearest' });
Reproducer
No response
PrimeReact version
8.0.1
React version
18.x
Language
ALL
Build / Runtime
Next.js
Browser(s)
No response
Steps to reproduce the behavior
Allow overflow-x on your web app.
Overflow it so horizontal scroll bar is shown.
Open MultiSelect dropdown and select an item.
Close and reopen MultiSelect dropdown.
Observe that the entire page shifts to the right to align with the left of the MultiSelect panel.
Expected behavior
Page should not shift horizontally unless the panel is out of view.
Describe the bug
When using horizontal scrolling on a page, opening the multiselect panel causes your app to scroll to the right to the start of the panel.
The line that makes this occur is: https://github.com/primefaces/primereact/blob/7cb4bc1327ce4ff71cc1943c205fa5a2f8613020/components/lib/multiselect/MultiSelect.js#L218
Changing inline option to nearest would not cause a scroll on the horizontal axis when opening the panel. Unless there is a reason why it uses start that I am unsure about.
highlightItem.scrollIntoView({ block: 'nearest', inline: nearest' });
Reproducer
No response
PrimeReact version
8.0.1
React version
18.x
Language
ALL
Build / Runtime
Next.js
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
Page should not shift horizontally unless the panel is out of view.