mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2025-02-17 17:01:12 -05:00
Don't close the text form when click on the textbox
This commit is contained in:
parent
ce9200b2f1
commit
04401859a2
1 changed files with 8 additions and 5 deletions
|
@ -952,11 +952,14 @@ export default class UI {
|
||||||
static createFormForText (p) {
|
static createFormForText (p) {
|
||||||
var tf = newHTML('div', 'pagetext off', p);
|
var tf = newHTML('div', 'pagetext off', p);
|
||||||
tf.setAttribute('id', 'textbox');
|
tf.setAttribute('id', 'textbox');
|
||||||
if (isAndroid) {
|
// If the textbox is click or touched, the input may lost focus,
|
||||||
tf.onmousedown = function (e) {
|
// and it may cause the text form miss closed.
|
||||||
|
var eatEvent = function (e) {
|
||||||
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
};
|
};
|
||||||
}
|
tf.ontouchstart = eatEvent;
|
||||||
|
tf.onmousedown = eatEvent;
|
||||||
var activetb = newHTML('form', 'pageform', tf);
|
var activetb = newHTML('form', 'pageform', tf);
|
||||||
activetb.name = 'activetextbox';
|
activetb.name = 'activetextbox';
|
||||||
activetb.id = 'myform';
|
activetb.id = 'myform';
|
||||||
|
|
Loading…
Reference in a new issue