mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
fix editbox domInput hidden when view rotated (#3228)
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user