-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[question] is it okay to use undocumented events such as virtualScrollerContentSizeChange #10116
Comments
Hi @bartvde Could you tell us more about your use case? |
thanks, I just tried with viewportInnerSizeChange but this does not work. So basically we have a small footer and we need to offset it at the bottom / right position in case a scrollbar is visible, see attached. Also a related question, we end up with some cases where apiRef is an empty object, how can we ensure the apiRef is always set? |
For reference this is our listener now:
Like calling the |
ok the apiRef being empty seems to be related to having conditional rendering (size.height > 0), otherwise we hit:
|
@bartvde It'd be great if you provided a live example but what I am guessing is, that you have something like this: function App() {
return (
...starting code
{size.height > 0 && <DataGrid apiRef={apiRef} {...otherProps} />}
...proceeding code
)
} The
Instead of conditionally rendering the grid, could you use
For this use-case, I feel |
The issue has been inactive for 7 days and has been automatically closed. If you think that it has been incorrectly closed, please reopen it and provide missing information (if any) or continue the last discussion. |
Order ID
72801
Duplicates
Latest version
The problem in depth 🔍
What is the reason some of the events are not documented? Can they still be used? Is it use at your own risk or do not use?
In my specific case I want to check if there are scrollbars and offset an element with the width/height of the vertical/horizontal scrollbars, and I am using a listener for virtualScrollerContentSizeChange to check if there are scrollbars. Thanks in advance for any guidance on undocumented events.
Your environment 🌎
`npx @mui/envinfo`
The text was updated successfully, but these errors were encountered: