From c10fe673a20a33f30e50d71040e246a5db003b2a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 26 Apr 2023 11:40:18 +0100 Subject: [PATCH] Don't let add-row processing intercept OK processing. Fixes https://gitlab.com/kicad/code/kicad/issues/14579 (cherry picked from commit 5b56cb6bdb89e92a144e8e4639cfa0618bbc8fff) --- common/grid_tricks.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/grid_tricks.cpp b/common/grid_tricks.cpp index c6a617cb17..740622e5e3 100644 --- a/common/grid_tricks.cpp +++ b/common/grid_tricks.cpp @@ -418,9 +418,16 @@ void GRID_TRICKS::onCharHook( wxKeyEvent& ev ) { bool handled = false; - if( ev.GetKeyCode() == WXK_RETURN && m_grid->GetGridCursorRow() == m_grid->GetNumberRows() - 1 ) + if( ( ev.GetKeyCode() == WXK_RETURN || ev.GetKeyCode() == WXK_NUMPAD_ENTER ) + && ev.GetModifiers() == wxMOD_NONE + && m_grid->GetGridCursorRow() == m_grid->GetNumberRows() - 1 ) { - if( m_grid->CommitPendingChanges() ) + if( m_grid->IsCellEditControlShown() ) + { + if( m_grid->CommitPendingChanges() ) + handled = true; + } + else { wxCommandEvent dummy; m_addHandler( dummy );