Skip to content

Commit

Permalink
Fix expression evaluation autocomplete bug (#5717)
Browse files Browse the repository at this point in the history
  • Loading branch information
elliette committed Apr 25, 2023
1 parent 617377e commit e4f512c
Show file tree
Hide file tree
Showing 3 changed files with 301 additions and 200 deletions.
Expand Up @@ -76,7 +76,7 @@ class ExpressionEvalFieldState extends State<ExpressionEvalField>
});
addAutoDisposeListener(
_autoCompleteController.selectTheSearchNotifier,
_handleSearch,
_handleSearchTermSelected,
);
addAutoDisposeListener(
_autoCompleteController.searchNotifier,
Expand Down Expand Up @@ -134,16 +134,17 @@ class ExpressionEvalFieldState extends State<ExpressionEvalField>
}
}

void _handleSearch() async {
void _handleSearchTermSelected() {
_autoCompleteController.clearCurrentSuggestion();
}

Future<void> _handleSearch() async {
final searchingValue = _autoCompleteController.search;

_autoCompleteController.clearCurrentSuggestion();

if (searchingValue.isNotEmpty) {
if (_autoCompleteController.selectTheSearch) {
_autoCompleteController.resetSearch();
return;
}
if (_autoCompleteController.selectTheSearch) return;

// We avoid clearing the list of possible matches here even though the
// current matches may be out of date as clearing results in flicker
Expand Down
1 change: 1 addition & 0 deletions packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md
Expand Up @@ -22,6 +22,7 @@ TODO: Remove this section if there are not any general updates.

## Debugger updates
* Improve support for inspecting `UserTag` and `MirrorReferent` instances - [#5490](https://github.com/flutter/devtools/pull/5490)
* Fixes expression evaluation bug where selecting an autocomplete result for a field would clear the current input - [#5717](https://github.com/flutter/devtools/pull/5717)

## Network profiler updates
TODO: Remove this section if there are not any general updates.
Expand Down

0 comments on commit e4f512c

Please sign in to comment.