From c97cd8d280ff3ae1792a4405b3fd47fc6a3bf004 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Tue, 21 Sep 2021 19:22:26 +0200 Subject: [PATCH] Invalidate selection of item being removed from wxNSTableView We need to explicitly invalidate selection of item being removed because it's not done by NSTableView (selection index is retained). --- src/osx/cocoa/listbox.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osx/cocoa/listbox.mm b/src/osx/cocoa/listbox.mm index f2e97a33da..0adf8f6b72 100644 --- a/src/osx/cocoa/listbox.mm +++ b/src/osx/cocoa/listbox.mm @@ -503,6 +503,11 @@ void wxListWidgetCocoaImpl::ListInsert( unsigned int n ) void wxListWidgetCocoaImpl::ListDelete( unsigned int n ) { + if ( [m_tableView isRowSelected:n] ) + { + [m_tableView deselectRow:n]; + } + [m_tableView reloadData]; if ( m_autoSize )