This repository was archived by the owner on Jul 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -101,10 +101,21 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
101101 setLabelStateInvalid ( true ) ;
102102 return ;
103103 }
104- const futureOrder = table
104+
105+ // Update state of ordered
106+ const updateOrderWithNewKey = table
105107 . getAllColumns ( )
106108 . map ( ( o : any ) => ( o . id === column . id ? newKey : o . id ) ) ;
107- table . setColumnOrder ( futureOrder ) ;
109+ table . setColumnOrder ( updateOrderWithNewKey ) ;
110+
111+ // Update state of sizing
112+ const updateSizeWithNewKey : Record < string , number > = { } ;
113+ table . getAllColumns ( ) . forEach ( ( o : any ) => {
114+ const key = o . id === column . id ? newKey : o . id ;
115+ updateSizeWithNewKey [ key ] = o . getSize ( ) ;
116+ } ) ;
117+ table . setColumnSizing ( updateSizeWithNewKey ) ;
118+
108119 setkeyState ( newKey ) ;
109120 dispatch ( {
110121 type : ActionTypes . UPDATE_COLUMN_LABEL ,
@@ -114,6 +125,7 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
114125 label : labelState ,
115126 } ) ;
116127 }
128+
117129 function handleKeyDown ( e : any ) {
118130 if ( e . key === "Enter" ) {
119131 persistLabelChange ( ) ;
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ export function databaseReducer(state: TableDataType, action: any) {
134134 const update_column_label_index = state . columns . findIndex (
135135 ( column : any ) => column . id === action . columnId
136136 ) ;
137+
137138 // Update configuration & row files on disk
138139 state . view . diskConfig . updateColumnKey (
139140 action . columnId ,
You can’t perform that action at this time.
0 commit comments