Prevent autofocus on mobile
Makes it difficult to fine-tune the location first
This commit is contained in:
@@ -13,6 +13,13 @@ export default class PlaceEditForm extends Component {
|
|||||||
this.description = this.args.place?.description || '';
|
this.description = this.args.place?.description || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get shouldAutofocus() {
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
return window.innerWidth > 768;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
handleSubmit(event) {
|
handleSubmit(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -45,7 +52,7 @@ export default class PlaceEditForm extends Component {
|
|||||||
{{on "input" this.updateTitle}}
|
{{on "input" this.updateTitle}}
|
||||||
class="form-control"
|
class="form-control"
|
||||||
placeholder="Name of the place"
|
placeholder="Name of the place"
|
||||||
autofocus
|
autofocus={{this.shouldAutofocus}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
Reference in New Issue
Block a user