Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT Tree Change Position

Tags:

tree

onclick

gwt

I added a Tree in my GWT WebApp. Now when you click on an element the whole site is scrolling down. This often means I loose focus on my clicked object, so I have to move the mouse and click again on the item.

This is very annoying when you always have to click two times on one item.

Maybe there is a posiibility to remove this "autofocus-option", or someone have other ideas?

like image 509
dominic Avatar asked Jun 27 '26 00:06

dominic


1 Answers

GWT 2.5.1 has a new option to fix that scrolling into view behavior. After creating a new Tree object call

tree.setScrollOnSelectEnabled(false);

to disable scrolling on selection.

Keep in mind that your tree will always be set to (0,0) scroll position after that. Which means that if the tree will happen to have scroll bars it might be a problem (it will then scroll to the top instead of keeping focus on selected item).

like image 121
alexp Avatar answered Jun 30 '26 07:06

alexp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!