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
Rows shifting during rowcount updates #297
Comments
How slightly is it? can you provide some numbers. Have you tried doing maybe |
Oh that is quite large of a number, so the @anthonydresser I was looking at the Microsoft repo that you're using this grid with, is there a live demo of it with the grid? Just curious about it and I don't have any Azure account. |
The Microsoft repo is an Electron application rather than web based, so it doesn't require a Azure account. Its an application for managing SQLSever, so we use SlickGrid as our results grid when performing queries. We don't have a "live example" per say, but you can certainly test it for free; if you are interested we have quick start guides for install the application and locally installing a sqlServer instance to connect to: https://docs.microsoft.com/en-us/sql/azure-data-studio/quickstart-sql-server?view=sql-server-2017 mac specific guide: |
Oh that is why it looks like VSCode 😉 I'm glad to see SlickGrid is used in some Microsoft projects/applications 😄 @6pac |
I've had a quick look, you've diagnosed the problem well - this really looks like a weakness in the core Slickgrid offset management code. Either way, it's going to require a few hours of digging and tracing (and it's the kind of thing I'd probably end up mapping out on paper too), for which I'm afraid I don't have time right now. You've clearly got the test harness all set up though, so if you're up for doing this, happy to apply the resulting patch. I suspect this may end up being quite tricky though, as it's relating to sub-pixel browser calculations - there may be some challenges in keeping the offset in lockstep with that. |
@ghiscoding thanks, I'll take a look at those changes. |
OK, I've had a long look at this one. Unfortunately, I don't think it's possible to fix. It appears that the offsets are being set correctly, and strangely it's the text that's moving, not the border lines. I think it's actually that the CSS itself has trouble with the really large offsets. I note if I retrieve the 'top' prop from the DOM, it comes back with exponential notation, suggesting that it's losing precision internally. One last idea would be to try reducing the MaxCssHeigh with the new defaults. I've run out of time this morning, but will try this later today. |
@ghiscoding @anthonydresser pleased to note that knocking a few zeros off the new maxSupportedCssHeight option appears to fix the issue. So in the end it looks like CSS simply being unable to cope with that large an offset accurately (it nearly gets there!) |
@ghiscoding cool! yup that's the commit, but as far as I can see it's a css/browser issue, not anything to do with js or slickgrid. the 'top' values in the image above come back from the DOM like that - it's not an artefact of js. possible the new bigint might be extended into the inner workings of the render engine ... which would fix this, I guess. |
When dealing with large row counts and when updating the row count, slight rows shifts occur even when the user is not scrolling.
repro: https://jsfiddle.net/r47kqpc9/16/
I've tracked it down to when the row top is calculated https://github.com/6pac/SlickGrid/blob/master/slick.grid.js#L1597 the
offset
value is slightly different after each row count update. That is being caused by thiscj
value slightly changing each time https://github.com/6pac/SlickGrid/blob/master/slick.grid.js#L2027 since it is calculated based on the exact row count (not some modulo of the value).It seems this cj value has something to do with dealing with the
maxsupportedcss
work around.Is there some work around to this? Or some way to reduce the visual impact this has?
The text was updated successfully, but these errors were encountered: