🐛fix(popover): prevent horizontal ghost scrolling #8350
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #8321
Hello :D ,
I've resolved the infinite scrolling issue in the Select component.
Changes:
Modified the shift padding value from
5
to0
inuse-popover.ts
Issue Details:
The Combobox renders through a portal, which made this issue a bit tricky to track down. 😅
To reproduce this issue, you can easily observe it by removing the padding from the Combobox's parent div in the Demo.
Root Cause:
The problem occurred when the Combobox had left padding. Since the shift middleware is enabled by default in the popover's defaultProps, the component would get pushed by
5px
padding and then pulled back by the shift, creating a loop that resulted in infinite scrolling.Solution:
I've set the default padding value of the shift middleware to
0
inuse-popover.ts.
Side Effects:
This change may affect the Popover Arrow component. If you'd like to modify only the Combobox without impacting other components, you can configure the Combobox props with
shift: { padding: 0 }
instead.If you could suggest an alternative approach, I'd be happy to implement it accordingly. Thank you.
Before
Normal
Bug
2025-10-11.2.59.40.mov
After
2025-10-11.3.00.11.mov