Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explorer scroll bar pointer isn't captured when it enters a webview #140101

Closed
Tyriar opened this issue Jan 4, 2022 · 6 comments · Fixed by #144260 or #144406
Closed

Explorer scroll bar pointer isn't captured when it enters a webview #140101

Tyriar opened this issue Jan 4, 2022 · 6 comments · Fixed by #144260 or #144406
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debt Code quality issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded webview Webview issues
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Jan 4, 2022

Repro:

  1. Open a webview
  2. Drag explorer scroll bar into webview, it ignores the events

Possible fix is to set/release pointer capture. Might be an issue in webviews?

recording (11)

@joaomoreno
Copy link
Member

joaomoreno commented Jan 5, 2022

Precedence: #94055, with fix 18b8ef0

@rebornix Wasn't your fix intended to fix this problem for all webviews?

@Tyriar
Copy link
Member Author

Tyriar commented Jan 5, 2022

@rebornix the pointer capture thing is how I solve this to allow continued listening to pointer events from within the webview even when the pointer is outside, so if that works it'll probably be more reliable than a cover element approach.

@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug webview Webview issues labels Jan 21, 2022
@mjbvz mjbvz added this to the Backlog milestone Jan 21, 2022
@mjbvz
Copy link
Contributor

mjbvz commented Jan 21, 2022

@Tyriar I haven't used the pointer capture api but on this case, we would want to set pointer capture on the scrollbar element, right?

/cc @alexdima Since I believe you implemented scrolling

@alexdima
Copy link
Member

@Tyriar What exact DOM API are you using? At https://mdn.github.io/dom-examples/pointer-lock/ I get three undesirable behaviors:

  • My mouse cursor becomes invisible
  • A browser message shows up saying I can press Escape to exit this mode
  • Escape is not dispatched to the DOM but is eaten up to exit this mode

@Tyriar
Copy link
Member Author

Tyriar commented Jan 21, 2022

@mjbvz yes.

@alexdima oh, I didn't know it would be ambiguous, here's what I do:

addDisposableDomListener(container, 'pointerdown', e => {
  container.setPointerCapture(e.pointerId);
});
addDisposableDomListener(container, 'pointerup', e => {
  container.releasePointerCapture(e.pointerId);
});

@mjbvz
Copy link
Contributor

mjbvz commented Jan 21, 2022

@alexdima I believe you were looking at the pointer-lock api which is different than the pointer capture api that @Tyriar was proposing: https://developer.mozilla.org/en-US/docs/Web/API/Element/setPointerCapture

@mjbvz mjbvz added the verified Verification succeeded label Mar 24, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debt Code quality issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded webview Webview issues
Projects
None yet
6 participants
@joaomoreno @rebornix @Tyriar @alexdima @mjbvz and others