提交 4924a8b8 编写于 作者: P Peng Lyu

Fix #85629. Resize find widget properly when resizing happens.

上级 293cabc6
......@@ -706,10 +706,12 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
if (this._resized) {
this._findInput.inputBox.layout();
let findInputWidth = this._findInput.inputBox.width;
let findInputWidth = this._findInput.inputBox.element.clientWidth;
if (findInputWidth > 0) {
this._replaceInput.width = findInputWidth;
}
} else if (this._isReplaceVisible) {
this._replaceInput.width = dom.getTotalWidth(this._findInput.domNode);
}
}
......@@ -1159,13 +1161,11 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
return;
}
const inputBoxWidth = width - FIND_ALL_CONTROLS_WIDTH;
const maxWidth = parseFloat(dom.getComputedStyle(this._domNode).maxWidth!) || 0;
if (width > maxWidth) {
return;
}
this._domNode.style.width = `${width}px`;
this._findInput.inputBox.width = inputBoxWidth;
if (this._isReplaceVisible) {
this._replaceInput.width = dom.getTotalWidth(this._findInput.domNode);
}
......@@ -1197,10 +1197,8 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
*/
}
const inputBoxWidth = width - FIND_ALL_CONTROLS_WIDTH;
this._domNode.style.width = `${width}px`;
this._findInput.inputBox.width = inputBoxWidth;
if (this._isReplaceVisible) {
this._replaceInput.width = dom.getTotalWidth(this._findInput.domNode);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册