From 58bb8831f3b32d1d05b4764589176fb7323506f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Tue, 27 Jan 2026 14:06:26 +0700 Subject: [PATCH] Prevent autofocus on mobile Makes it difficult to fine-tune the location first --- app/components/place-edit-form.gjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/components/place-edit-form.gjs b/app/components/place-edit-form.gjs index 38e3465..7dc68c6 100644 --- a/app/components/place-edit-form.gjs +++ b/app/components/place-edit-form.gjs @@ -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}} />