-
-
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
[XGrid] Second iteration on resizing logic #436
[XGrid] Second iteration on resizing logic #436
Conversation
f44973c
to
6303a77
Compare
e4811ac
to
11e65c2
Compare
https://github.com/mui-org/material-ui/pull/18872/files#r361437151 it's exactly what we have @josgraha :p |
A demonstration that the fix for #177 is working: https://codesandbox.io/s/modest-herschel-4vkmo?file=/package.json |
9f84db6
to
0a269d2
Compare
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
d8731e3
to
5ccf943
Compare
aff8d59
to
b5a20e8
Compare
b5a20e8
to
aafdd69
Compare
}), | ||
}; | ||
const width = column.width!; | ||
const dragConfig = { |
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.
usememo? avoid to recreate the functions and rerender the subtree...
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.
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.
But the value is spread, so no performance issues here.
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.
the value is spread but when you do (event)=> something(event)
it creates a new function on each render and so shallow equal will never work and the sub tree will always rerender
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.
It's applied on a div, so using a memo won't help performance. It won't prune a large react rendering tree, the only case where it helps with performance.
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
a1b1e1e
to
f0c5ffc
Compare
58ebf1e
to
f477235
Compare
f477235
to
9ed7b17
Compare
Fix alternatives button clicks, e.g. if you click on the previous page button while your mouse is over the dragging area, it fails.
Fix interaction area, the whole separator should be interactive