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

api.setColumnWidth doesn't take effect unless I manually drag / resize the column #15018

Closed
httpete opened this issue Oct 18, 2024 · 2 comments
Closed
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@httpete
Copy link

httpete commented Oct 18, 2024

Steps to reproduce

I am trying to call setColumnWidth on a keydown event. If I navigate to the header cell, and then call api.setColumnWidth(field, 100); it won't apply. If I manually tweak ever so slightly the drag border, and then issue the call , it works great. It should work whether or not I dragged. I am searching through the code, there is some logic bound up in
https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/hooks/features/columnResize/useGridColumnResize.tsx#L297

I am trying to synthetically call the same events to simulate, but it wont work.

Current behavior

No response

Expected behavior

No response

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: resize setColumnWidth
Order ID: 79357

@httpete httpete added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 18, 2024
@github-actions github-actions bot added component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Oct 18, 2024
@httpete
Copy link
Author

httpete commented Oct 18, 2024

I think I figured this out. It is because the resizer removes the flex property.

@httpete httpete closed this as completed Oct 18, 2024
@github-actions github-actions bot removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 18, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@httpete How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
None yet
Development

No branches or pull requests

1 participant