diff --git a/textinput/textinput.go b/textinput/textinput.go index 49631e8..21f352b 100644 --- a/textinput/textinput.go +++ b/textinput/textinput.go @@ -800,6 +800,9 @@ func Paste() tea.Msg { } func clamp(v, low, high int) int { + if high < low { + low, high = high, low + } return min(high, max(low, v)) }