Merge pull request #3251 from Python-37/Fix-bug-of-some-IMEs-cannot-input-in-terminal

Fix bug of some IMEs cannot input in terminal
This commit is contained in:
Daniel Imms
2021-03-18 08:49:56 -07:00
committed by GitHub
+3 -2
View File
@@ -222,8 +222,9 @@ export class CompositionHelper {
const compositionViewBounds = this._compositionView.getBoundingClientRect();
this._textarea.style.left = cursorLeft + 'px';
this._textarea.style.top = cursorTop + 'px';
this._textarea.style.width = compositionViewBounds.width + 'px';
this._textarea.style.height = compositionViewBounds.height + 'px';
// Ensure the text area is at least 1x1, otherwise certain IMEs may break
this._textarea.style.width = Math.max(compositionViewBounds.width, 1) + 'px';
this._textarea.style.height = Math.max(compositionViewBounds.height, 1) + 'px';
this._textarea.style.lineHeight = compositionViewBounds.height + 'px';
}