-
Notifications
You must be signed in to change notification settings - Fork 489
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
Add an accessible resizing option #1368
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.
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.
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.
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.
Thank you for the contribution. The code looks good.
Fixes #563.
setColumnSizing()
.Functioning: