diff --git a/lib/dropdown_search.dart b/lib/dropdown_search.dart index 8c3b8378..c69ce08f 100644 --- a/lib/dropdown_search.dart +++ b/lib/dropdown_search.dart @@ -738,7 +738,8 @@ class DropdownSearchState extends State> { } else { await _openSelectDialog(); } - + //dismiss either by selecting items OR clicking outside the popup + widget.popupProps.onDismissed?.call(); _handleFocus(false); } diff --git a/lib/src/widgets/selection_widget.dart b/lib/src/widgets/selection_widget.dart index 63ae7eae..e27352cb 100644 --- a/lib/src/widgets/selection_widget.dart +++ b/lib/src/widgets/selection_widget.dart @@ -223,11 +223,7 @@ class SelectionWidgetState extends State> { } ///close popup - void closePopup() { - Navigator.pop(context); - - widget.popupProps.onDismissed?.call(); - } + void closePopup() => Navigator.pop(context); Widget _multiSelectionValidation() { if (!widget.isMultiSelectionMode) return SizedBox.shrink();