diff --git a/cocos2d/core/platform/CCView.js b/cocos2d/core/platform/CCView.js index 34bb999de1..01547c1694 100644 --- a/cocos2d/core/platform/CCView.js +++ b/cocos2d/core/platform/CCView.js @@ -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 () {