Close active cell editor when showing/hiding columns.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17425
This commit is contained in:
Jeff Young 2024-03-24 10:08:59 +00:00
parent bd59fb7768
commit f3ce3bc758
2 changed files with 6 additions and 2 deletions

View File

@ -445,7 +445,7 @@ void GRID_TRICKS::doPopupSelection( wxCommandEvent& event )
break; break;
default: default:
if( menu_id >= GRIDTRICKS_FIRST_SHOWHIDE ) if( menu_id >= GRIDTRICKS_FIRST_SHOWHIDE && m_grid->CommitPendingChanges( false ) )
{ {
int col = menu_id - GRIDTRICKS_FIRST_SHOWHIDE; int col = menu_id - GRIDTRICKS_FIRST_SHOWHIDE;

View File

@ -146,13 +146,17 @@ protected:
{ {
if( m_fieldsCtrl->GetTextValue( row, FIELD_NAME_COLUMN ) == fieldName ) if( m_fieldsCtrl->GetTextValue( row, FIELD_NAME_COLUMN ) == fieldName )
{ {
m_fieldsCtrl->SetToggleValue( show, row, SHOW_FIELD_COLUMN ); if( m_grid->CommitPendingChanges( false ) )
m_fieldsCtrl->SetToggleValue( show, row, SHOW_FIELD_COLUMN );
break; break;
} }
} }
} }
else else
{
GRID_TRICKS::doPopupSelection( event ); GRID_TRICKS::doPopupSelection( event );
}
} }
} }