Hello. I’m using Tree component and found it quite pretty and useful. But there one thing I cannot do with it. I cannot scroll to participant item. I could select participant item but also I need to scroll to it or set focus to selected item. Yes, there methods scrollToIndex but I have no idea what index corresponds to participant item of Tree. Anyway I tried to call scrollToIndex with different argument values and nothing happens. If selected item is out of visible area I need to scroll towards its position. If method scrollToIndex is not useful for this feature how could I do it?
Hello @Denis.65, have you had a chance to try the scrollToItem feature that was added to TreeGrid in 25.0?
There 24.9.5 vaadin version in my project currently. Updated vaadin to 25.0.0 and getting error on ‘prepare-frontend’ step((
Anyway, the Tree component keeps inner TreeGrid object private and there no method scrollToItem in Tree class. I think I could call scrollToItem via reflection. Seems not good way)
Tried to build Tree component with vaadin 25.0.0 version. Got an error:
[ERROR] [vite]: Rollup failed to resolve import “@polymer/polymer/polymer-element.js” from “C:/Work/nri/application/src/main/frontend/generated/jar-resources/custom-grid-tree-toggle.js”.
[ERROR] This is most likely unintended because it can break your application at runtime.
[ERROR] If you do want to externalize this module explicitly add it to
I released version 4.1.0 today, which works with Vaadin 25.0.0, it also adds the new Tree#scrollToItem API, which should be effectively the same as TreeGrid#scrollToItem.
Wow! Now it’s working, great! Thank you all very much)