ant-design/components/_util/styleChecker.tsx
zombieJ bfec344de5
Not show spining mask in ie <= 10 (#14511)
* not show spining mask in ie <= 10
fix #14365

* revert, let's use css check for this

* add styleChecker

* add pointer-events check

* delay check spin not support when did mount

* use css hack replace style check
2019-01-26 11:55:53 +08:00

14 lines
505 B
TypeScript

function isStyleSupport(styleName: string | Array<string>): boolean {
if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
const styleNameList = Array.isArray(styleName) ? styleName : [styleName];
const { documentElement } = window.document;
return styleNameList.some(name => name in documentElement.style);
}
return false;
}
export const isFlexSupported = isStyleSupport(['flex', 'webkitFlex', 'Flex', 'msFlex']);
export default isStyleSupport;