Skip to content

Commit

Permalink
Dart convention
Browse files Browse the repository at this point in the history
  • Loading branch information
JhonaCodes committed Jan 11, 2025
1 parent 5e1e537 commit 045cce4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/core/multi_select.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ class _MultiSelectFieldState<T> extends State<MultiSelectField<T>>

// Step 3: Handle the pop-up menu behavior based on keyboard visibility.
if (_menuController.isOpen && isKeyboardOpen) {
print("Operating tru tru");
// If the menu is open and the keyboard is visible, adjust the menu's position upwards
// to avoid overlapping with the keyboard.
_menuController.open(position: Offset(0, -(currentMenuHeight + 7)));
Expand Down Expand Up @@ -322,8 +321,9 @@ class _MultiSelectFieldState<T> extends State<MultiSelectField<T>>
});

/// Help to focus on textField when click on any part of the widget.
if (!_focusNodeTextField.hasFocus)
if (!_focusNodeTextField.hasFocus) {
_focusNodeTextField.requestFocus();
}
_arrowEnableOrNot();
},
onTapDown: (down) {
Expand Down Expand Up @@ -658,8 +658,9 @@ class _MultiSelectFieldState<T> extends State<MultiSelectField<T>>
_onSelected = true;

/// When select any element we need focus again on TextField if is in use.
if (widget.useTextFilter && !_focusNodeTextField.hasFocus)
if (widget.useTextFilter && !_focusNodeTextField.hasFocus) {
_focusNodeTextField.requestFocus();
}
}

/// Ensure that when the dropdown is opened again, all items are available for selection.
Expand All @@ -678,8 +679,9 @@ class _MultiSelectFieldState<T> extends State<MultiSelectField<T>>
/// Otherwise, add the new Choice to the list and reset `isUsingRemove` to false.
_selectedChoice.add(va);

if (widget.useTextFilter && !_focusNodeTextField.hasFocus)
if (widget.useTextFilter && !_focusNodeTextField.hasFocus) {
_focusNodeTextField.requestFocus();
}
}
}

Expand Down

0 comments on commit 045cce4

Please sign in to comment.