Skip to content

Commit 241eb8a

Browse files
committed
remove listeners fix: #218
1 parent f558f0f commit 241eb8a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- Fix [Issue: #222](https://github.com/maheshj01/searchfield/issues/222) Suggestion overlay dimensions not updated on resize
44
- Fix [Issue: #224](https://github.com/maheshj01/searchfield/issues/224) calling setState in listener caused setState exception
5+
- Fix [Issue: #218](https://github.com/maheshj01/searchfield/issues/218) FocusNode listener is not removed
56

67
### [1.2.7] - Apr 16, 2025
78

lib/src/searchfield.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,8 @@ class _SearchFieldState<T> extends State<SearchField<T>> {
426426
if (widget.controller == null) {
427427
searchController!.dispose();
428428
}
429-
if (widget.focusNode == null) {
430-
_searchFocus!.dispose();
431-
}
432-
429+
_searchFocus?.removeListener(() {});
430+
_searchFocus?.dispose();
433431
removeOverlay();
434432
super.dispose();
435433
}

0 commit comments

Comments
 (0)