Move initial cursor place to the end for @mention reply (#375)

pull/379/head
TAKAHASHI Shuuji 2023-01-09 04:22:45 +09:00 zatwierdzone przez GitHub
rodzic c5c0e2bfe5
commit b5b4a8ac5d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -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