You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
setDropMode, setDragFilter, setPartNameGenerator, and many other TreeGrid methods calldataCommunicator.reset to re-render items, typically to update certain attributes. This operation is effectively equivalent to refreshAll and triggers a full reset of the hierarchy, which causes an annoying scroll position reset on the client-side.
In cases where the grid's hierarchy isn't expected to change – which is true for all the mentioned methods – it should be enough to simply call refreshItem for items that are currently visible.
Expected outcome
The Flow framework should provide an API to retrieve items that are currently in the viewport. With this API, the Flow component could call refreshItem for visible items instead of doing a full reset.
Minimal reproducible example
This issue has become especially problematic after #6339 added a data communicator reset to setDropMode. When setting the drop mode dynamically on drag start, the scroll can now jump to a quite random position, significantly disrupting the dragging process.
The solution isn't complete. The API can currently return more items than necessary because DataCommunicator keeps expanded items in the key mapper after they have been visited once. Some additional logic is needed to filter out such items when they are out of the requested range.
Description
setDropMode
,setDragFilter
,setPartNameGenerator
, and many other TreeGrid methods calldataCommunicator.reset
to re-render items, typically to update certain attributes. This operation is effectively equivalent torefreshAll
and triggers a full reset of the hierarchy, which causes an annoying scroll position reset on the client-side.In cases where the grid's hierarchy isn't expected to change – which is true for all the mentioned methods – it should be enough to simply call
refreshItem
for items that are currently visible.Expected outcome
The Flow framework should provide an API to retrieve items that are currently in the viewport. With this API, the Flow component could call
refreshItem
for visible items instead of doing a full reset.Minimal reproducible example
This issue has become especially problematic after #6339 added a data communicator reset to
setDropMode
. When setting the drop mode dynamically on drag start, the scroll can now jump to a quite random position, significantly disrupting the dragging process.Steps to reproduce
Screen.Recording.2024-10-11.at.15.45.42.mov
Environment
Vaadin version(s): 24.5 and earlier
OS: Mac OS
Browsers
No response
The text was updated successfully, but these errors were encountered: