-
Notifications
You must be signed in to change notification settings - Fork 1k
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
DataTable: Missing rows when filtering with VirtualScroller in Firefox #5118
Comments
Any idea when this will be fixed? |
No idea unless you have a PrimeTek PRO account and can request this fix through your PRO support. |
In Firefox, when content transitions from a scrollable to a non-scrollable due to filtering, the calculation logic is not triggered. There is a temporary workaround: manually invoke the There hasn't been extensive testing, so it's unclear if this workaround may introduce new issues. |
@kl-nevermore On which element should scrollInView be invoked? Thank you :) |
const tableRef = useRef()
<DataTable
ref={tableRef}
value={cars}
filters={filters}
filterDisplay="row"
globalFilterFields={["vin", "year", "brand", "color"]}
scrollable
scrollHeight="400px"
virtualScrollerOptions={{ itemSize: 46 }}
tableStyle={{ minWidth: "50rem" }}
onValueChange={(e) => {
// try it
const vs = tableRef.current.getVirtualScroller();
tableRef.scrollInView();
}}
> |
Thank you for your reply but neither the tableRef object not the tableRef.current has a scrollIntoView function
am I missing something? Here is a sandbox of the change. |
super, yes it works. Thank you for your help! Hopefully the original bug would be fixed soon |
Hey, I recently came across the same issue and tried applying the workaround mentioned here, but noticed that when using TypeScript |
I don't see |
There is no |
what is this statement then? |
OH I see the typescript needs to say props are optional on scrollInView |
Exactly yeah, are you also able to see the other issue I mentioned with sorting in Firefox? |
I didn't check that other virtual scroller in firefox issue but i believe you. |
@ssode interesting your using ScrollInView with NO params but it looks like |
@ssode PR submitted to fix the typescript but I didn't make Index optional i made the |
Hey @melloware, looks good. I think what was happening when calling |
Hey @melloware , I'm not sure if this bug should've been closed. What I was trying to show in the reproducer I linked was that using the workaround mentioned here seems to cause an issue similar to the original when you add sorting into the mix, where after sorting a column the rows are invisible in Firefox, and also where the scrollbar ends up after sorting is not consistent in Firefox, whereas in Chromium-based browsers, the scrollbar will always reset to the top after sorting. It seems like there is a larger issue at play when it comes to the VirtualScroller and Firefox that this workaround doesn't completely solve. Let me know if I should create a separate issue. |
yep it got closed when i merged my PR I reopened it as I only fixed the Typescript issue. |
Describe the bug
When you scroll down some rows and use the filter, no result is shown. In Chrome it works, but not in Firefox. I used the example from the documentation (virtualscroller) and added some filters to reproduce the problem in my application.
Reproducer
https://codesandbox.io/s/primereact-demo-forked-kfn7nh?file=/src/App.js:745-754
PrimeReact version
10.0.5
React version
18.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
Firefox 118.0.2 (64-bit)
Steps to reproduce the behavior
Expected behavior
Row with the copied entry should be shown.
The text was updated successfully, but these errors were encountered: