提交 b3b0e640 编写于 作者: J Joao Moreno

fix scm input box nudge

上级 4b9e3429
......@@ -160,6 +160,7 @@ export class InputBox extends Widget {
if (this.options.flexibleHeight) {
this.mirror = dom.append(wrapper, $('div.mirror'));
this.mirror.innerHTML = ' ';
} else {
this.input.type = this.options.type || 'text';
this.input.setAttribute('wrap', 'off');
......@@ -443,9 +444,16 @@ export class InputBox extends Widget {
}
const value = this.value || this.placeholder;
let lastCharCode = value.charCodeAt(value.length - 1);
let suffix = lastCharCode === 10 ? ' ' : '';
this.mirror.textContent = value + suffix;
const lastCharCode = value.charCodeAt(value.length - 1);
const suffix = lastCharCode === 10 ? ' ' : '';
const mirrorTextContent = value + suffix;
if (mirrorTextContent) {
this.mirror.textContent = value + suffix;
} else {
this.mirror.innerHTML = ' ';
}
this.layout();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册