Prevent autofocus on mobile

Makes it difficult to fine-tune the location first
This commit is contained in:
Râu Cao 2026-01-27 14:06:26 +07:00
parent 585837cae7
commit 58bb8831f3
Signed by: raucao
GPG Key ID: 37036C356E56CC51

View File

@ -13,6 +13,13 @@ export default class PlaceEditForm extends Component {
this.description = this.args.place?.description || '';
}
get shouldAutofocus() {
if (typeof window !== 'undefined') {
return window.innerWidth > 768;
}
return false;
}
@action
handleSubmit(event) {
event.preventDefault();
@ -45,7 +52,7 @@ export default class PlaceEditForm extends Component {
{{on "input" this.updateTitle}}
class="form-control"
placeholder="Name of the place"
autofocus
autofocus={{this.shouldAutofocus}}
/>
</div>
<div class="form-group">