After a text box was cleared, trying to delete from the (now empty) text box using backspace crashes the program.
Reproduce
Run the clear_textbox example. Enter anything that is not an empty string into the textbox (it contains "Hello" by default, which is fine). Press "Clear". Then press Backspace in the textbox.
Logs
thread 'main' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/string.rs:1933:29:
assertion failed: self.is_char_boundary(n)
Description
After a text box was cleared, trying to delete from the (now empty) text box using backspace crashes the program.
Reproduce
Run the
clear_textbox
example. Enter anything that is not an empty string into the textbox (it contains "Hello" by default, which is fine). Press "Clear". Then press Backspace in the textbox.Logs