google / gxui

An experimental Go cross platform UI library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Textbox backspace crash bug

vzex opened this issue · comments

commented

because the cart position may move after the "func (t *TextBoxController) Backspace() { " called,
in line 465 of textbox_controller.go, the end may be larger than len(text),and it will crash.
fix:
add
if s.end > len(text) {s.end = len(text)}
before
copy(text[s.start:], text[s.end:])