Quasar: QTable & VirtualScroll: Add a new argument that `scrollTo` still working even if the item is already visible

Created on 6 Aug 2020  路  5Comments  路  Source: quasarframework/quasar

Is your feature request related to a problem? Please describe.
I asked this question in #7517 in the past and thank you for providing the edge option.
However, I desperately need the feature that scrollTo can still scroll past even when the item is already visible.

Many functions need this in our application, for example:

  1. Search the next item (highlight and scrollTo)
  2. Move to the specified number of rows (like number G in VIM)

If there is no movement at this time, the user experience will be bad :(

Describe the solution you'd like
Provide a new option (e.g., force) let scrollTo function always scroll.

Describe alternatives you've considered
My current practice is to jump away first, then jump back, for example:
Currently, I am at the top of the table and want to scroll to the third row (visible).
I鈥檒l scroll to any invisible row (e.g., 20), and then immediately scroll back to row 3.

Obviously, this is a bad solution :(

Additional context
It will be better if you can provide a function to return the number of visible items on the table/list.

feature request has PR

All 5 comments

For the visible items: either listen to @virtual-scroll event that emits also from and to or read from ref to virtual scroll virtualScrollSliceRange

Thanks @pdanpdan 馃榾, but I think that are not the visible items but the loaded items.
My current workaround is like this (very imprecise):

ah, visible - sorry, you're on your own there, and by that I mean use an intersection observer on the items - it would be too much overhead

Wow! amazing efficiency
I appreciate it -- The Great Quasar!

Enhancement will be available in Quasar v1.13.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jean-moldovan picture jean-moldovan  路  3Comments

Bangood picture Bangood  路  3Comments

mesqueeb picture mesqueeb  路  3Comments

alexeigs picture alexeigs  路  3Comments

xereda picture xereda  路  3Comments