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:
Adam Barth
2016-01-21 14:11:50 -08:00
parent d10c5628dc
commit f176ed27de
7 changed files with 29 additions and 6 deletions

View File

@@ -89,6 +89,7 @@ class MealFragmentState extends State<MealFragment> {
new Text(meal.displayDate),
new Input(
key: descriptionKey,
autofocus: true,
placeholder: 'Describe meal',
onChanged: _handleDescriptionChanged
),

View File

@@ -141,6 +141,7 @@ class MeasurementFragmentState extends State<MeasurementFragment> {
),
new Input(
key: weightKey,
autofocus: true,
placeholder: 'Enter weight',
keyboardType: KeyboardType.number,
onChanged: _handleWeightChanged

View File

@@ -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

View File

@@ -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'
),
]