W3cubDocs

/Web APIs

XRTransientInputHitTestSource: cancel() method

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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

Syntax

js

cancel()

Parameters

None.

Return value

None (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.

js

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 68 No No 81 No 58 No 13.0

© 2005–2023 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