MCPcopy Create free account
hub / github.com/angular/components / _isTouchPlatform

Method _isTouchPlatform

src/material/tooltip/tooltip.ts:865–881  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

863 }
864
865 private _isTouchPlatform(): boolean {
866 const detectHoverCapability = this._defaultOptions?.detectHoverCapability;
867
868 if (typeof detectHoverCapability === 'function') {
869 return !detectHoverCapability();
870 }
871
872 if (this._platform.IOS || this._platform.ANDROID) {
873 // If we detected iOS or Android, it's definitely supported.
874 return true;
875 } else if (!this._platform.isBrowser) {
876 // If it's not a browser, it's definitely not supported.
877 return false;
878 }
879
880 return !!detectHoverCapability && this._mediaMatcher.matchMedia('(any-hover: none)').matches;
881 }
882
883 /** Disables the native browser gestures, based on how the tooltip has been configured. */
884 private _disableNativeGesturesIfNecessary() {

Calls 1

matchMediaMethod · 0.45

Tested by

no test coverage detected