Autofocus the search box when the "Search" button is clicked.
This commit adds the much-needed ability to autofocus the search box on macOS.
This commit is contained in:
@@ -338,8 +338,8 @@ class _HomePageState extends State<HomePage> {
|
||||
_searchText = _textController.text;
|
||||
|
||||
// Request focus on the search box
|
||||
// For Windows only for now. "Platform.isWindows" can be removed if other platforms has been tested.
|
||||
if (Platform.isWindows) {
|
||||
// For Windows and macOS only for now. This if statement can be removed if other platforms has been tested.
|
||||
if (Platform.isWindows || Platform.isMacOS) {
|
||||
searchBoxFocusNode.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user