From be28f6a7b4134e696fd69d75b8f8e55b16eb4c79 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Tue, 23 Sep 2025 08:27:51 +0300 Subject: [PATCH] Give a visual indicator when the note is unsaved --- lib/music_library_web/components/notes_component.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/music_library_web/components/notes_component.ex b/lib/music_library_web/components/notes_component.ex index 86f4669c..510a405f 100644 --- a/lib/music_library_web/components/notes_component.ex +++ b/lib/music_library_web/components/notes_component.ex @@ -65,7 +65,11 @@ defmodule MusicLibraryWeb.NotesComponent do phx-submit="save" > <.textarea - class="w-full min-h-128 md:min-h-164 overflow-scroll font-mono text-sm/4" + class={[ + "w-full min-h-128 md:min-h-164 overflow-scroll font-mono", + @form[:content].value != @note.content && + "border-amber-300 focus-visible:border-amber-300" + ]} field={@form[:content]} />