From 54f89bcd1a7fb0b92b65d8c0ea3847d635e11133 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Sun, 6 Jul 2025 12:45:37 +0200 Subject: Allow adding and removing templates --- Map/Presentation/MapEditor.swift | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'Map/Presentation/MapEditor.swift') diff --git a/Map/Presentation/MapEditor.swift b/Map/Presentation/MapEditor.swift index 5dc1adb..5005a73 100644 --- a/Map/Presentation/MapEditor.swift +++ b/Map/Presentation/MapEditor.swift @@ -91,10 +91,17 @@ struct MapEditor: View { } adaptiveStack { ZStack(alignment: .topLeading) { - MapTextEditor(document: $document, highlightRanges: results, selectedRange: selectedTerm) - .background(Color.Theme.UI.background) - .foregroundColor(Color.Theme.UI.foreground) - .frame(minHeight: 96.0) + MapTextEditor( + text: Binding( + get: { document.text }, + set: { document.text = $0 } + ), + highlightRanges: results, + selectedRange: selectedTerm + ) + .background(Color.Theme.UI.background) + .foregroundColor(Color.Theme.UI.foreground) + .frame(minHeight: 96.0) } .background(Color.Theme.UI.background) .cornerRadius(5.0) -- cgit