File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
packages/dropdown_button2 Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## UNRELEASED
2
+
3
+ - Avoid dropdown internal FocusNode listener leak when replaced by an external FocusNode
4
+
1
5
## 3.0.0-beta.22
2
6
3
7
- Fix errorStyle has no effect for DropdownButtonFormField2, closes #327 .
Original file line number Diff line number Diff line change @@ -493,6 +493,10 @@ class _DropdownButton2State<T> extends State<DropdownButton2<T>> with WidgetsBin
493
493
super .didUpdateWidget (oldWidget);
494
494
if (widget.focusNode != oldWidget.focusNode) {
495
495
oldWidget.focusNode? .removeListener (_handleFocusChanged);
496
+ if (_internalNode != null && widget.focusNode != null ) {
497
+ _internalNode! .removeListener (_handleFocusChanged);
498
+ }
499
+
496
500
if (widget.focusNode == null ) {
497
501
_internalNode ?? = _createFocusNode ();
498
502
}
You can’t perform that action at this time.
0 commit comments