mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(refresher): correctly select shadow root on older browsers (#21237)
This commit is contained in:
@@ -5,6 +5,19 @@ import { Side } from '../interface';
|
||||
declare const __zone_symbol__requestAnimationFrame: any;
|
||||
declare const requestAnimationFrame: any;
|
||||
|
||||
/**
|
||||
* Gets the root context of a shadow dom element
|
||||
* On newer browsers this will be the shadowRoot,
|
||||
* but for older browser this may just be the
|
||||
* element itself.
|
||||
*
|
||||
* Useful for whenever you need to explicitly
|
||||
* do "myElement.shadowRoot!.querySelector(...)".
|
||||
*/
|
||||
export const getElementRoot = (el: HTMLElement, fallback: HTMLElement = el) => {
|
||||
return el.shadowRoot || fallback;
|
||||
};
|
||||
|
||||
/**
|
||||
* Patched version of requestAnimationFrame that avoids ngzone
|
||||
* Use only when you know ngzone should not run
|
||||
|
||||
Reference in New Issue
Block a user