Skip to content
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

Resizable column width is reset after checking cell #373

Open
shyzw opened this issue Oct 27, 2022 · 2 comments
Open

Resizable column width is reset after checking cell #373

shyzw opened this issue Oct 27, 2022 · 2 comments

Comments

@shyzw
Copy link

shyzw commented Oct 27, 2022

Versions

package version
react 17.0.2
rsuite-table 5.7.1

What is the expected behavior?

The column keeps width after checking cell.

What is the current behavior?

The column width is reset after checking cell.

What are the steps to reproduce?

Table.-.React.Suite.mp4

Any additional comments? (optional)

@simonguo
Copy link
Member

simonguo commented Nov 2, 2022

Hi @shyzw
The custom column width is reset because the component re-renders when the table's children are changed. In order to save the column width, you can get the column width through the column's onResize callback, save it in the state, and let the column width be controlled.

Reference example: https://table.rsuitejs.com/#custom-cell

https://github.com/rsuite/rsuite-table/pull/374/files

@shyzw
Copy link
Author

shyzw commented Nov 2, 2022

Hi @simonguo
Thank you for your reply. I will try that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants