Don't let add-row processing intercept OK processing.
Fixes https://gitlab.com/kicad/code/kicad/issues/14579
(cherry picked from commit 5b56cb6bdb
)
This commit is contained in:
parent
105f8a1720
commit
c10fe673a2
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue