Skip to content

Commit 017e366

Browse files
Fix: Clear search text on load with ApplicationIdle priority
Refined the solution to handle Revit keyboard shortcut bleed-through by clearing `tbxSearch.Text` directly in the window's `Loaded` event with `DispatcherPriority.ApplicationIdle`. This ensures the clearing happens after all pending input events are processed by Revit, effectively removing the errant characters while maintaining the default search bar focus as requested by the maintainer. Fixes #76 Co-authored-by: chuongmep <31106432+chuongmep@users.noreply.github.com>
1 parent fde52c9 commit 017e366

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

AddInManager/View/FrmAddInManager.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ private void FrmAddInManager_OnLoaded(object sender, RoutedEventArgs e)
3131
// We clear the search text after the window is fully loaded and idle.
3232
Dispatcher.BeginInvoke(new Action(() =>
3333
{
34-
viewModel.SearchText = string.Empty;
35-
}), DispatcherPriority.ContextIdle);
34+
tbxSearch.Text = string.Empty;
35+
}), DispatcherPriority.ApplicationIdle);
3636
}
3737

3838
private void TbxDescription_OnLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)

0 commit comments

Comments
 (0)