Don't autofocus Input widgets by default
Instead, require the developer to opt-in to autofocusing because autofocusing can be disruptive. Fixes #1307
This commit is contained in:
@@ -89,6 +89,7 @@ class MealFragmentState extends State<MealFragment> {
|
||||
new Text(meal.displayDate),
|
||||
new Input(
|
||||
key: descriptionKey,
|
||||
autofocus: true,
|
||||
placeholder: 'Describe meal',
|
||||
onChanged: _handleDescriptionChanged
|
||||
),
|
||||
|
||||
@@ -141,6 +141,7 @@ class MeasurementFragmentState extends State<MeasurementFragment> {
|
||||
),
|
||||
new Input(
|
||||
key: weightKey,
|
||||
autofocus: true,
|
||||
placeholder: 'Enter weight',
|
||||
keyboardType: KeyboardType.number,
|
||||
onChanged: _handleWeightChanged
|
||||
|
||||
@@ -62,6 +62,7 @@ class SettingsFragmentState extends State<SettingsFragment> {
|
||||
title: new Text("Goal Weight"),
|
||||
content: new Input(
|
||||
key: weightGoalKey,
|
||||
autofocus: true,
|
||||
placeholder: 'Goal weight in lbs',
|
||||
keyboardType: KeyboardType.number,
|
||||
onChanged: _handleGoalWeightChanged
|
||||
|
||||
@@ -236,6 +236,7 @@ class StockHomeState extends State<StockHome> {
|
||||
),
|
||||
center: new Input(
|
||||
key: searchFieldKey,
|
||||
autofocus: true,
|
||||
placeholder: 'Search stocks',
|
||||
onChanged: _handleSearchQueryChanged
|
||||
),
|
||||
@@ -252,6 +253,7 @@ class StockHomeState extends State<StockHome> {
|
||||
children: <Widget>[
|
||||
new Input(
|
||||
key: companyNameKey,
|
||||
autofocus: true,
|
||||
placeholder: 'Company Name'
|
||||
),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user