Skip to content

Commit 9a90f1f

Browse files
authored
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
2 parents 145b487 + 886f285 commit 9a90f1f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/browser/input/CompositionHelper.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,9 @@ export class CompositionHelper {
222222
const compositionViewBounds = this._compositionView.getBoundingClientRect();
223223
this._textarea.style.left = cursorLeft + 'px';
224224
this._textarea.style.top = cursorTop + 'px';
225-
this._textarea.style.width = compositionViewBounds.width + 'px';
226-
this._textarea.style.height = compositionViewBounds.height + 'px';
225+
// Ensure the text area is at least 1x1, otherwise certain IMEs may break
226+
this._textarea.style.width = Math.max(compositionViewBounds.width, 1) + 'px';
227+
this._textarea.style.height = Math.max(compositionViewBounds.height, 1) + 'px';
227228
this._textarea.style.lineHeight = compositionViewBounds.height + 'px';
228229
}
229230

0 commit comments

Comments
 (0)