From 2e9987e7222bd2609b597aba8a5ed0978678d2fa Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 17 Jun 2025 19:56:20 +0100 Subject: [PATCH] Clear child flags for items whose undo/redo is managed by parent. Fixes https://gitlab.com/kicad/code/kicad/-/issues/21111 --- eeschema/sch_commit.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eeschema/sch_commit.cpp b/eeschema/sch_commit.cpp index 382a6305c9..6781976271 100644 --- a/eeschema/sch_commit.cpp +++ b/eeschema/sch_commit.cpp @@ -415,6 +415,16 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags ) // after edition (selected items must keep their selection flag). const int selected_mask = ( SELECTED | STARTPOINT | ENDPOINT ); schItem->ClearFlags( EDA_ITEM_ALL_FLAGS - selected_mask ); + + if( schItem->Type() == SCH_SHEET_T || schItem->Type() == SCH_SYMBOL_T ) + { + schItem->RunOnChildren( + [&]( SCH_ITEM* child ) + { + child->ClearFlags( EDA_ITEM_ALL_FLAGS - selected_mask ); + }, + RECURSE_MODE::NO_RECURSE ); + } } if( schematic )