api.setColumnWidth doesn't take effect unless I manually drag / resize the column #15018
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/
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
Search keywords: resize setColumnWidth
Order ID: 79357
The text was updated successfully, but these errors were encountered: