Skip to content

Commit

Permalink
fix: Retrieve pointerLockElement from shadowRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
fengpingping committed Oct 17, 2024
1 parent bc35413 commit 7e46ad7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/NumericInput/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,20 @@ class NumericInput extends InputElement {
super._onInputKeyDown(evt);
}

protected _getPointerLockElementByShadowRoot(pointerLockElement: any): boolean {
const shadowRoot = pointerLockElement.shadowRoot;
if (shadowRoot) {
const pointerLockElement = shadowRoot.pointerLockElement;
return this._getPointerLockElementByShadowRoot(pointerLockElement);
}
return pointerLockElement === this._sliderControl.dom;
}

protected _isScrolling() {
if (!this._sliderControl) return false;
if (document.pointerLockElement && document.pointerLockElement.shadowRoot) {
return this._getPointerLockElementByShadowRoot(document.pointerLockElement);
}
return document.pointerLockElement === this._sliderControl.dom;
}

Expand Down

0 comments on commit 7e46ad7

Please sign in to comment.