Allow selection on completion detail. Fix #55853#81198
Conversation
| // Editor.IContentWidget.allowEditorOverflow | ||
| readonly allowEditorOverflow = true; | ||
| readonly suppressMouseDown = true; | ||
| readonly suppressMouseDown = false; |
There was a problem hiding this comment.
This makes sure details widget get onclick events (otherwise textInputArea gets it).
|
|
||
| this.el.style.height = this.header.offsetHeight + this.docs.offsetHeight + (this.borderWidth * 2) + 'px'; | ||
| this.el.style.userSelect = 'text'; | ||
| this.el.tabIndex = -1; |
There was a problem hiding this comment.
userSelect -> make selectable
tabIndex -> otherwise element.focus() has no effect
joaomoreno
left a comment
There was a problem hiding this comment.
Seems to work pretty well. A few comments:
- One can focus the details view and then focus something else in the workbench and the widget will stay open;
- Not a blocker, but I've found that the view doesn't automatically scroll if I click+drag up and down to the edges of the view, when there's enough content to show a scroll bar.
| } | ||
| })); | ||
|
|
||
| this._toDispose.add(this._widget.getValue().onDetailsKeyDown(e => { |
There was a problem hiding this comment.
Should we maybe simply forward the event to the regular keydown handler instead of duplicating the handling here?
There was a problem hiding this comment.
@joaomoreno I can't do that, as those events only trigger proper action when editor is being focused. For this to work, details element has to be in focus when selection happens.
There was a problem hiding this comment.
I take that back. I should find a way to do that, otherwise many keyboards shortcuts won't work while details is in focus.
|
I realized this can be much simpler. I was using Also simplified the event handling, now it's simple: all keypress that's not merely ctrl/shift/alt/meta are handled through editor, and ctrl/cmd + c trigger browser default action and do not propagate. |
|
@octref Focus handling seems much better, and so do the keyboard events! |
|
OK, shipping it 🚢 |
Fixes #55853