Merge pull request #1080 from gissehel/caret-position-fix

Caret position fix : Include PR #1074
This commit is contained in:
Kevin Zhang 2022-06-28 08:41:17 -05:00 committed by GitHub
commit 51a8916cfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -538,7 +538,9 @@ namespace Flow.Launcher
private void MoveQueryTextToEnd()
{
Dispatcher.Invoke(() => QueryTextBox.CaretIndex = QueryTextBox.Text.Length);
// QueryTextBox seems to be update with a DispatcherPriority as low as ContextIdle.
// To ensure QueryTextBox is up to date with QueryText from the View, we need to Dispatch with such a priority
Dispatcher.Invoke(() => QueryTextBox.CaretIndex = QueryTextBox.Text.Length, System.Windows.Threading.DispatcherPriority.ContextIdle);
}
public void InitializeColorScheme()

View file

@ -346,6 +346,9 @@ namespace Flow.Launcher.ViewModel
{
// re-query is done in QueryText's setter method
QueryText = queryText;
// set to false so the subsequent set true triggers
// PropertyChanged and MoveQueryTextToEnd is called
QueryTextCursorMovedToEnd = false;
}
else if (reQuery)
{