fix editbox domInput hidden when view rotated (#3228)

This commit is contained in:
PP
2018-09-11 16:00:30 +08:00
committed by pandamicro
parent 604f4bd2ce
commit a52bcb09e8
+9
View File
@@ -348,6 +348,15 @@ cc.js.mixin(View.prototype, {
cc.game.container.style['-webkit-transform-origin'] = '0px 0px 0px';
cc.game.container.style.transformOrigin = '0px 0px 0px';
this._isRotated = true;
// Fix for issue: https://github.com/cocos-creator/fireball/issues/8365
// Reference: https://www.douban.com/note/343402554/
// For Chrome, z-index not working after container transform rotate 90deg.
// Because 'transform' style adds canvas (the top-element of container) to a new stack context.
// That causes the DOM Input was hidden under canvas.
// This should be done after container rotated, instead of in style-mobile.css.
cc.game.canvas.style['-webkit-transform'] = 'translateZ(0px)';
cc.game.canvas.style.transform = 'translateZ(0px)';
}
if (this._orientationChanging) {
setTimeout(function () {