-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
DataTable: width is not working for column and event onColumnResizeEnd don't fire on reduce size of column #6777
Comments
I have the same issue when using |
@gabrielhpugliese - Thanks for the update. The max-width property is not working only min-width is working and the event onColumnResizeEnd doesn't fire on reducing size of the column. |
have you both tested 10.6.6 and made sure its still an issue in 10.6.6? |
Please fork the Stackblitz project and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days. |
@melloware Yes I have upgraded PrimeReact to the 10.6.6 version but face the same issue. |
OK can someone create a StackBlitz please? |
Hello @melloware, thanks for the attention! He is my reproduction: https://stackblitz.com/edit/3ccbnb-ltg7xv?file=src%2FApp.jsx If you want to point me in the code where I can start debugging this I am happy to do so. |
Thanks for the reproducer I have marked it as a bug. |
I've just been thinking about that ticket and have to say, it doesn't seem to be a bug at all. If you guys give a column a min-width of 100px, why should it get smaller? You explicitly said, 'don't go less than 100px,' so that column doesn't. With that in mind, why should |
So the same should apply to To give you more context on my usage: I am setting |
@gabrielhpugliese I agree with you - just had a problem with columns too if content length changed on items. Guess that are two different things. One more thing, did you try I dont know how Vanilla HTML tables will work on auto layout if content change while scrolling - maybe the behavior is just inherited |
@sja-cslab @melloware - Thanks for the quick reply. If I used If I used the conclusion is dynamic width is not working and If I used min-width then the event onColumnResizeEnd doesn't fire on reduced column size. |
@sja-cslab I have tried the |
Thats correct but it should keep the Initial width then. For me at least without width jumping |
Indeed there's no width jumping but in small screens it's just not usable because there's no horizontal scroll |
Hi folks, Facing the same issue here. I have set dynamic widths to each column, but the table doesn't respect that and columns are stretched to max available space.
Has anybody found any work around to this problem ? PS: My implementation: |
I discovered PrimeReact after having tried several datagrid/table components from several libraries. I was thrilled to see PrimeReact @sandipan-saha The only workaround that currently kind of works for me is to pad the actual column content, so that each string is of same length. With that I got rid of the table headers jumping horizontally when scrolling. Not sure yet, but this might have some effects on the filter function and perhaps sort as well. But this width issue isn't nearly as annoying as the blank view when scrolling quickly (happens even with |
Thanks @sja-cslab I will keep an eye on those. Also, I think I'm able to live with the scroll issues after all, because otherwise |
Describe the bug
I have created SPFx with React solution. I have used "primereact": "^9.4.0" version.
I need to set the column width dynamically in the Prime React data-table column.
I have added the same code as below to bind dynamic columns in the Prime React data-table.
Everything is working as expected except the width property.
Also, I have tried max-width and min-width properties, and it works as expected.
If I use min-width and max-width and try to reduce the column size onColumnResizeEnd don't fire to reduce size of column due to min-width.
Can anyone help me with the same?
Thanks
Reproducer
https://stackblitz.com/edit/3ccbnb-ltg7xv?file=src%2FApp.jsx
PrimeReact version
9.4.0
React version
17.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
Chrome
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: