File tree Expand file tree Collapse file tree
client/packages/lowcoder/src/comps/comps/navComp/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -244,18 +244,9 @@ export function menuPropertyView(itemsComp: NavListCompType) {
244244
245245 const newJson = buildJsonFromTree ( newItems ) ;
246246
247- // Clear all existing items and re-add in new order
248- const currentLength = itemsComp . getView ( ) . length ;
249-
250- // Delete all items from end to start
251- for ( let i = currentLength - 1 ; i >= 0 ; i -- ) {
252- itemsComp . deleteItem ( i ) ;
253- }
254-
255- // Add items back in new order
256- newJson . forEach ( ( itemJson ) => {
257- itemsComp . addItem ( itemJson ) ;
258- } ) ;
247+ // Use setChildrensAction for atomic update instead of delete-all/add-all
248+ // This is more efficient and prevents UI glitches from multiple re-renders
249+ itemsComp . dispatch ( itemsComp . setChildrensAction ( newJson ) ) ;
259250 } ;
260251
261252 return controlItem (
You can’t perform that action at this time.
0 commit comments