mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-01-25 21:31:04 +03:00
Add safety check in textinput's clamp
This commit is contained in:
parent
fd306528f9
commit
746834a7ce
@ -800,6 +800,9 @@ func Paste() tea.Msg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func clamp(v, low, high int) int {
|
func clamp(v, low, high int) int {
|
||||||
|
if high < low {
|
||||||
|
low, high = high, low
|
||||||
|
}
|
||||||
return min(high, max(low, v))
|
return min(high, max(low, v))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user