-
Notifications
You must be signed in to change notification settings - Fork 374
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
[ui-storagebrowser] add useWindowSize hook to get window size #3930
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know all you did was introduce the hook which is nice but..
I'm not a big fan of setting heights using JS. This problem is solvable using CSS layout so let's do that instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
useLayoutEffect(() => { | ||
handleResize(); | ||
|
||
window.addEventListener('resize', handleResize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the ResizeObserver API instead of window so that this code is triggered if parent containers get resized without and actual resize of the window.
I think this is a limitation of the underlying antd table, at least I had the same issue when creating the infinite scroll table. |
What changes were proposed in this pull request?
How was this patch tested?