How can I still focus on the textfield when I set suggestion box controller close ?
SuYungCheng opened this issue · comments
SuYungCheng commented
Steps to reproduce
- I need to hide suggestion box when typing in the textfield.
- I use onChanged and set suggestionsBoxController.close() inside.
- The textfield is unfoucs.
Expected results
The textfield is still focus, but suggestion box is gone.
Actual results
The textfield unfocus and suggestion box is gone.
Package Version
4.6.2
Platform
iOS
Code sample
Code sample
suggestionsCallback: (pattern) {
return cardList;
},
...
textFieldConfiguration: TextFieldConfiguration(
textAlign: TextAlign.end,
onChanged: (value) {
_suggestionsBoxController.close();
},
Logs
Logs
[Paste your logs here]
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]clragon commented
Hi @SuYungCheng
It seems you are using Version 4.x of the package, which is outdated. Please upgrade to the latest package version.
In Version 5.x, the SuggestionsController.close
method allows passing retainFocus: true
to prevent the text field from losing focus.
Additionally, the GitHub issues are not for usage questions. Please check out the links we have provided for questions.
Best regards.