Multi-select combo box, Scroll position has been not preserved #4389
Replies: 3 comments
-
|
Disclaimer: This is a very experimental bot using OpenAI's GPT-4. The answers may not be correct, a human will review the answer and update it if necessary. Sorry, I don't know how to help with that. I did do a search though, and I managed to find these other Discussions that might be similar or related to your question. Give them a read to see if they answer your question. If they do, head back here and update this discussion and mark it as answered, pointing others to the related discussion:
|
Beta Was this translation helpful? Give feedback.
-
|
The intended and current behavior of the Paste Multiselect Combobox is to preserve the scroll position after each selection. This is handled in the component by setting the highlightedIndex to the selected item's index, which prevents the list from resetting to the top after a selection is made. This matches what is shown in the Paste website examples and is confirmed by the implementation in the codebase—there is no known issue or open ticket about scroll position resetting after selection, and the documentation does not mention this as a bug or provide alternative guidance [source]. If you are seeing the scroll reset in your environment, it may be due to custom overrides, differences in how Downshift or virtualization is integrated, or possibly outdated dependencies. To ensure scroll position is preserved, check that your usage does not override the highlightedIndex logic, that you are not resetting the items array in a way that causes the list to re-render from the top, and that you are using a recent version of the component. If you have custom state management or filtering, make sure the list of items and the highlightedIndex are kept in sync with the component's expectations. If you are using the state hook, avoid resetting the state in a way that would cause the list to scroll to the top. Let me know if you want to dig into your specific implementation or share a code snippet for more targeted troubleshooting. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
Hi, the scroll reset is seen mainly on searching by an input. I have attached a screen recording for reference |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When using the component, we’ve observed that when the user types the scroll position resets to the top after selecting the first item in the list, different than when they use the mouse to select it. According to the presented at Paster website, the expected behaviour (aligned with the customer’s request) is that the scroll position should remain unchanged after each selection either doing the input texting or selecting with the mouse.
During an initial investigation by Shreya Seth, it appears that the behaviour of the component in our environment differs from what is shown in the examples on the Paste website.
What we’re hoping to clarify or get support on:
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions