Add an accessible resizing option#1368
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
|
@nithinrdy is attempting to deploy a commit to the Rowy Team on Vercel. A member of the Team first needs to authorize it. |
Performing the update on mouse-down caused this issue where dragging the mouse around after clicking would result in the edge of the column to move along with it. Updating on mouse-up instead avoids this issue.
- Better component name - Remove unnecessary map() call
|
Just wondering -- anything else I'd need to do before/while the PR is in review? |
|
Thank you for the PR. The PR works but I feel it can be done in a better way. In its current form, we can't set size through the keyboard because it uses the mouse event. Another point - calling I propose that we use
const [reactTable, setReactTable] = useAtom(reactTableAtom, tableScope)
const table = useReactTable({})
useMemo(() => {
setReactTable(table)
}, [table])
export default function SetColumnWidthModal({ close }) {
const [column] = useAtom(columnMenuAtom, tableScope)
const [table] = useAtom(reactTableAtom, tableScope)
const onSubmit = (e) => {
table.setColumnSizing((old) => {
return {
...old,
[column.name]: e.target.value
}
}
}
return <></>
}Having react table in an atom should be useful in the future too. What do you think about this approach? |
atom, not just the table headers.
nithinrdy
left a comment
There was a problem hiding this comment.
Hey @il3ven, thanks a lot for taking a look.
I made some changes based on your suggestions, and I agree its much cleaner and it works just as well, and cutting down on unnecessary updates using useMemo is certainly not something I had thought of.
I encountered a small hiccup though, I'd appreciate any ideas. Thanks.
il3ven
left a comment
There was a problem hiding this comment.
Thank you for the contribution. The code looks good.
Fixes #563.
setColumnSizing().Functioning: