Don't close the text form when click on the textbox

This commit is contained in:
Yueyu 2021-09-01 20:14:10 +08:00
parent ce9200b2f1
commit 04401859a2

View file

@ -952,11 +952,14 @@ export default class UI {
static createFormForText (p) {
var tf = newHTML('div', 'pagetext off', p);
tf.setAttribute('id', 'textbox');
if (isAndroid) {
tf.onmousedown = function (e) {
// If the textbox is click or touched, the input may lost focus,
// and it may cause the text form miss closed.
var eatEvent = function (e) {
e.stopPropagation();
e.preventDefault();
};
}
tf.ontouchstart = eatEvent;
tf.onmousedown = eatEvent;
var activetb = newHTML('form', 'pageform', tf);
activetb.name = 'activetextbox';
activetb.id = 'myform';