ui
ui copied to clipboard
[patch] textbox.v needs a trivial fix for touch devices
On touch devices it does not subscribe touch events like touch _down that is needed to focus the textbox and move cursor for example.
Patch bellow fixes it.
--- textbox.v 2021-09-17 23:41:40.015377118 +0200
+++ /home/rz/.vmodules/ui/textbox.v 2021-09-23 00:25:17.860375560 +0200
@@ -212,8 +212,10 @@
subscriber.subscribe_method(events.on_char, tb_char, tb)
// subscriber.subscribe_method(events.on_key_up, tb_key_up, tb)
subscriber.subscribe_method(events.on_mouse_down, tb_mouse_down, tb)
+ subscriber.subscribe_method(events.on_touch_down, tb_mouse_down, tb)
subscriber.subscribe_method(events.on_mouse_move, tb_mouse_move, tb)
subscriber.subscribe_method(events.on_mouse_up, tb_mouse_up, tb)
+ subscriber.subscribe_method(events.on_touch_up, tb_mouse_up, tb)
}
[manualfree]
Submitted https://github.com/vlang/ui/pull/395