mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-13 02:41:08 +00:00
Move initial cursor place to the end for @mention reply (#375)
This commit is contained in:
parent
c5c0e2bfe5
commit
b5b4a8ac5d
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue