fix: place cursor at beginning of text field when quoting a note

When a user hits Quote, the new post screen opens with the nostr URI
pre-filled but the cursor was at the end (after the URI). This moves
the cursor to the beginning so the user can immediately start typing
their commentary.

https://claude.ai/code/session_01RPseKC9GJ8hs3GGBR85ezw
This commit is contained in:
Claude
2026-03-31 04:01:05 +00:00
parent 91f5dffc6d
commit 3a850ba26c
3 changed files with 11 additions and 2 deletions
@@ -25,6 +25,13 @@ import androidx.compose.ui.text.TextRange
import kotlin.math.max
import kotlin.math.min
fun TextFieldState.setTextAndPlaceCursorAtBeginning(text: String) {
edit {
replace(0, length, text)
selection = TextRange(0, 0)
}
}
fun TextFieldState.insertUrlAtCursor(url: String) {
edit {
var toInsert = url.trim()