Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VirtualScroll Qtable is scrolled one unit when using QMenu in "Body" Slot #15598

Open
RamonDonadeu opened this issue Mar 21, 2023 · 6 comments
Open
Assignees
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@RamonDonadeu
Copy link

RamonDonadeu commented Mar 21, 2023

What happened?

I have a long QTable with virtual scroll enabled, and each row has some options set in a QMenu component inside "Body" Slot.
So When on the top of the table, user click on right mouse button to open the menu, and then click on an option, the table rows are scrolled, 1 row unit, to the top, so the first row gets under the header of the table.
I tested it, and the problem is the virtual-table option, without it the bug won't reproduce.

What did you expect to happen?

To not scroll automatically one row.

Reproduction URL

https://codepen.io/RamonDonadeu/pen/wvEYvZq?editors=111

How to reproduce?

1.- Go to providen link
2.- Make sure you are on the top of the table.
3.- Right click in any row of the table
4.- Then you can reproduce it with diferent actions:
4.1- Click on an option of the menu, in this case 'Test'
4.2- Left click again the same row
4.3- Right click in the same row.

Now the Table should have scrolled up one row.
The issue is not reproduced if you right click to open the menu, and then click on any other row different than the clicked before.
Or, if you are not at the top of the table.

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

Platforms/Browsers

Chrome, Brave
Safari

Not tested in Firefox but I suppose it will be te same

Quasar info output

Operating System - Darwin(22.3.0) - darwin/arm64
NodeJs - 18.12.1

Global packages
  NPM - 8.19.2
  yarn - 1.22.19
  @quasar/cli - 1.3.2
  @quasar/icongenie - Not installed
  cordova - Not installed

Important local packages
  quasar - 2.10.2 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 1.1.3 -- Quasar Framework App CLI with Vite
  @quasar/extras - 1.15.6 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.2.45 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.1.6
  pinia - 2.0.26 -- Intuitive, type safe and flexible Store for Vue
  vuex - Not installed
  vite - 2.9.15 -- Native-ESM powered web dev build tool
  eslint - 8.28.0 -- An AST-based pattern checker for JavaScript.
  electron - Not installed
  electron-packager - Not installed
  electron-builder - Not installed
  register-service-worker - 1.7.2 -- Script for registering service worker, with hooks
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

Networking
  Host - mac126.local
  en0 - 10.2.6.244

Relevant log output

No response

Additional context

No response

@github-actions github-actions bot added area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite labels Mar 21, 2023
@pdanpdan
Copy link
Collaborator

Seems to be related to #14450, but this happens when the QTable gets focus.
I'll take a look

@pdanpdan
Copy link
Collaborator

I'm not sure there is something automatic that can be done (looking into it)

But it can be fixed in CSS (add scroll-margin-top equal to the size of the sticky on top)
The same should be true for sticky on left
https://codepen.io/pdanpdan/pen/vYzVOBd

@RamonDonadeu
Copy link
Author

Okay I'll do that. Thanks!

pdanpdan added a commit to pdanpdan/quasar that referenced this issue Mar 21, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Mar 21, 2023
pdanpdan added a commit to pdanpdan/quasar that referenced this issue Mar 21, 2023
rstoenescu pushed a commit that referenced this issue Mar 21, 2023
rstoenescu pushed a commit that referenced this issue Mar 21, 2023
@pdanpdan
Copy link
Collaborator

Please keep this open until i can check if something automatic can be done

@dsl101
Copy link
Contributor

dsl101 commented Jun 7, 2023

I'm working on a QTable virtual scroll issue atm, and going through all the open tickets. Just to note, in case it's important, I only see this specific problem in Chrome (116) and not in Firefox (113), both on Windows.

@rdonadeu
Copy link

rdonadeu commented Jun 7, 2023

I work on Mac, And it also happens in Chrome and in Safari. Also recently I found out, that if table is bigger than window height, it scrolls one row up under the TH, and also the entire table is scrolled upwards too.

I had a similar problem only happening in safari where I had a dialog container hidden on the bottom of the page, and when using context menu inside table. Also scrolled the q-layout under q-header. Removing that dialog container solved the problem, but it was in "position: Absolute" So it should not be interpreted as it was using screen space. Even Inspecting the browser showed that the layout was not reaching the bottom of the page, and nothing was occupying that space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

4 participants