XRTransientInputHitTestSource.cancel()

The cancel() method of the XRTransientInputHitTestSource interface unsubscribes a transient input hit test.

Syntax

cancel()

Parameters

None.

Return value

Returns undefined.

Examples

Unsubscribe from hit test

The cancel() method unsubscribes from a transient input hit test source. Since the XRTransientInputHitTestSource object will no longer be usable, you can clean up and set it to null.

transientHitTestSource.cancel();
transientHitTestSource = null;

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
cancel
81
81
No
No
No
No
No
81
No
No
No
13.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XRTransientInputHitTestSource/cancel