提交 fc38646f 编写于 作者: D Daniel Imms

Fix terminal link hover widget getting cut off

Adding animation to the find widget regressed this by adding overflow:hidden
to the terminal panel. The solution was to wrap the find widget in another
element and apply overflow:hidden to that.
上级 b5e0e6a8
...@@ -3,16 +3,23 @@ ...@@ -3,16 +3,23 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
.monaco-workbench .simple-find-part { .monaco-workbench .simple-find-part-wrapper {
overflow: hidden;
z-index: 10; z-index: 10;
position: absolute; position: absolute;
top: -40px; top: 0;
right: 28px; right: 28px;
width: 220px;
max-width: calc(100% - 28px - 28px - 8px);
}
.monaco-workbench .simple-find-part {
z-index: 10;
position: relative;
top: -40px;
display: flex; display: flex;
padding: 4px; padding: 4px;
align-items: center; align-items: center;
width: 220px;
max-width: calc(100% - 28px - 28px - 8px);
-webkit-transition: top 200ms linear; -webkit-transition: top 200ms linear;
-o-transition: top 200ms linear; -o-transition: top 200ms linear;
......
...@@ -25,6 +25,7 @@ const NLS_CLOSE_BTN_LABEL = nls.localize('label.closeButton', "Close"); ...@@ -25,6 +25,7 @@ const NLS_CLOSE_BTN_LABEL = nls.localize('label.closeButton', "Close");
export abstract class SimpleFindWidget extends Widget { export abstract class SimpleFindWidget extends Widget {
protected _findInput: FindInput; protected _findInput: FindInput;
protected _domNode: HTMLElement; protected _domNode: HTMLElement;
protected _innerDomNode: HTMLElement;
protected _isVisible: boolean; protected _isVisible: boolean;
protected _focusTracker: dom.IFocusTracker; protected _focusTracker: dom.IFocusTracker;
protected _findInputFocusTracker: dom.IFocusTracker; protected _findInputFocusTracker: dom.IFocusTracker;
...@@ -91,14 +92,19 @@ export abstract class SimpleFindWidget extends Widget { ...@@ -91,14 +92,19 @@ export abstract class SimpleFindWidget extends Widget {
onKeyDown: (e) => { } onKeyDown: (e) => { }
}); });
this._innerDomNode = document.createElement('div');
this._innerDomNode.classList.add('simple-find-part');
this._innerDomNode.appendChild(this._findInput.domNode);
this._innerDomNode.appendChild(prevBtn.domNode);
this._innerDomNode.appendChild(nextBtn.domNode);
this._innerDomNode.appendChild(closeBtn.domNode);
// _domNode wraps _innerDomNode, ensuring that
this._domNode = document.createElement('div'); this._domNode = document.createElement('div');
this._domNode.classList.add('simple-find-part'); this._domNode.classList.add('simple-find-part-wrapper');
this._domNode.appendChild(this._findInput.domNode); this._domNode.appendChild(this._innerDomNode);
this._domNode.appendChild(prevBtn.domNode);
this._domNode.appendChild(nextBtn.domNode);
this._domNode.appendChild(closeBtn.domNode);
this.onkeyup(this._domNode, e => { this.onkeyup(this._innerDomNode, e => {
if (e.equals(KeyCode.Escape)) { if (e.equals(KeyCode.Escape)) {
this.hide(); this.hide();
e.preventDefault(); e.preventDefault();
...@@ -106,7 +112,7 @@ export abstract class SimpleFindWidget extends Widget { ...@@ -106,7 +112,7 @@ export abstract class SimpleFindWidget extends Widget {
} }
}); });
this._focusTracker = this._register(dom.trackFocus(this._domNode)); this._focusTracker = this._register(dom.trackFocus(this._innerDomNode));
this._register(this._focusTracker.addFocusListener(this.onFocusTrackerFocus.bind(this))); this._register(this._focusTracker.addFocusListener(this.onFocusTrackerFocus.bind(this)));
this._register(this._focusTracker.addBlurListener(this.onFocusTrackerBlur.bind(this))); this._register(this._focusTracker.addBlurListener(this.onFocusTrackerBlur.bind(this)));
...@@ -114,7 +120,7 @@ export abstract class SimpleFindWidget extends Widget { ...@@ -114,7 +120,7 @@ export abstract class SimpleFindWidget extends Widget {
this._register(this._findInputFocusTracker.addFocusListener(this.onFindInputFocusTrackerFocus.bind(this))); this._register(this._findInputFocusTracker.addFocusListener(this.onFindInputFocusTrackerFocus.bind(this)));
this._register(this._findInputFocusTracker.addBlurListener(this.onFindInputFocusTrackerBlur.bind(this))); this._register(this._findInputFocusTracker.addBlurListener(this.onFindInputFocusTrackerBlur.bind(this)));
this._register(dom.addDisposableListener(this._domNode, 'click', (event) => { this._register(dom.addDisposableListener(this._innerDomNode, 'click', (event) => {
event.stopPropagation(); event.stopPropagation();
})); }));
} }
...@@ -163,13 +169,13 @@ export abstract class SimpleFindWidget extends Widget { ...@@ -163,13 +169,13 @@ export abstract class SimpleFindWidget extends Widget {
this._isVisible = true; this._isVisible = true;
setTimeout(() => { setTimeout(() => {
dom.addClass(this._domNode, 'visible'); dom.addClass(this._innerDomNode, 'visible');
this._domNode.setAttribute('aria-hidden', 'false'); this._innerDomNode.setAttribute('aria-hidden', 'false');
if (!this.animate) { if (!this.animate) {
dom.addClass(this._domNode, 'noanimation'); dom.addClass(this._innerDomNode, 'noanimation');
} }
setTimeout(() => { setTimeout(() => {
dom.removeClass(this._domNode, 'noanimation'); dom.removeClass(this._innerDomNode, 'noanimation');
this._findInput.select(); this._findInput.select();
}, 200); }, 200);
}, 0); }, 0);
...@@ -179,8 +185,8 @@ export abstract class SimpleFindWidget extends Widget { ...@@ -179,8 +185,8 @@ export abstract class SimpleFindWidget extends Widget {
if (this._isVisible) { if (this._isVisible) {
this._isVisible = false; this._isVisible = false;
dom.removeClass(this._domNode, 'visible'); dom.removeClass(this._innerDomNode, 'visible');
this._domNode.setAttribute('aria-hidden', 'true'); this._innerDomNode.setAttribute('aria-hidden', 'true');
} }
} }
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
background-color: transparent!important; background-color: transparent!important;
user-select: initial; user-select: initial;
position: relative; position: relative;
overflow: hidden;
} }
.monaco-workbench .panel.integrated-terminal .terminal-outer-container { .monaco-workbench .panel.integrated-terminal .terminal-outer-container {
......
...@@ -151,7 +151,6 @@ export class TerminalLinkHandler { ...@@ -151,7 +151,6 @@ export class TerminalLinkHandler {
} }
private _validateLocalLink(link: string, callback: (isValid: boolean) => void): void { private _validateLocalLink(link: string, callback: (isValid: boolean) => void): void {
console.log('validate link: ', link);
this._resolvePath(link).then(resolvedLink => callback(!!resolvedLink)); this._resolvePath(link).then(resolvedLink => callback(!!resolvedLink));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册