Hello,
What should I do to programmatically focus an EditBox with Cocos2D-JS 3.7?
This topic suggests doing something like:
this->_editBox->touchDownAction(this->_editBox, Widget::TouchEventType::ENDED);
I guess it would translate into:
this._editBox.touchDownAction(this._editBox, cc.CONTROL_EVENT_TOUCH_DOWN);
(Not sure about what is the JS equivalent of Widget::TouchEventType::ENDED
).
Anyway, this does not focus the input in the web version (actually didn’t try on iOS/Android yet).
For information, CCEditBox.js contains this code:
touchDownAction: function (sender, controlEvent) {
//this._editBoxImpl.openKeyboard();
}
Perhaps there is a better component for text input?