From c943864edc65c0aa083e0de45463a46c24163a68 Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Tue, 24 Feb 2026 22:26:25 +1100 Subject: [PATCH] Auto-focus the post text box on new post --- assets/js/controllers/postedit.js | 3 ++- views/posts/edit.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/js/controllers/postedit.js b/assets/js/controllers/postedit.js index dfb3b55..54679c5 100644 --- a/assets/js/controllers/postedit.js +++ b/assets/js/controllers/postedit.js @@ -2,12 +2,13 @@ import { Controller } from "@hotwired/stimulus" import { showToast } from "../services/toast"; export default class PosteditController extends Controller { + static targets = ['bodyTextEdit']; static values = { saveAction: String, }; connect() { - console.log("connected"); + this.bodyTextEditTarget.focus(); } async save(ev) { diff --git a/views/posts/edit.html b/views/posts/edit.html index 871f691..475c9a0 100644 --- a/views/posts/edit.html +++ b/views/posts/edit.html @@ -9,7 +9,7 @@
- +
{{ if $isPublished }}