diff --git a/activities/views/compose.py b/activities/views/compose.py index eb27b18..827b105 100644 --- a/activities/views/compose.py +++ b/activities/views/compose.py @@ -60,6 +60,11 @@ class Compose(FormView): self.fields["text"].widget.attrs[ "_" ] = f""" + init + -- Move cursor to the end of existing text + set my.selectionStart to my.value.length + end + on load or input -- Unicode-aware counting to match Python set characters to Array.from(my.value.trim()).length