Grid does not restore scroll postion when placed inside TabSheet

Hello!
I’m using version 8.3.1 in my project and I faced a problem when Grid does not restore scroll position when I place it inside TabSheet and switch to another tab and back.

How to reproduce it:

  1. Add Grid to TabSheet
  2. Add some another tabs to TabSheet
  3. Switch to Tab with Grid and scroll down
  4. Switch to another Tab
  5. Switch back to Tab with grid
  6. Scroll position is not restored

I understand that when tab is being switched, content from previous tab is being removed from browser, and it is being rerendered when we switch back, but why don’t vaadin restore Grid scroll state?
In my application I place Grids inside TabSheet, because users want to work with different Grids without loosing their state.
It worked with Table - after Tab switch Table restores it’s scroll position.

Any workaround here?

Yes, this is true.

I have written small add-on that remedies this problem:
GridScrollExtension add-on

That’s great!
Does it have any documentation?

I have found some example at https://github.com/TatuLund/grid-scroll-extension/blob/master/GridScrollExtension-demo/src/main/java/org/vaadin/extension/demo/DemoUI.java

But in this demo we have to set scroll position manually. How can we force grid to restore it’s sroll position when tab was switched?

It is automatic. In the demo there is additional demonstration for get and set scroll position API’s with buttons. But you do not need that.

Oh, thank you! It works great!

Thats good to hear. Feel free to rate and give feedback in the Directory.