@atlaskit/editor-plugin-table
Version:
Table plugin for the @atlaskit/editor
16 lines • 637 B
JavaScript
import memorizeOne from 'memoize-one';
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
export const isAnchorSupported = memorizeOne(() => {
if (window.CSS && window.CSS.supports) {
return window.CSS.supports('anchor-name: --anchor');
}
return false;
});
export const isNativeStickySupported = isDragAndDropEnabled => {
const safariVersion = getBrowserInfo().safari_version;
const isBrowserSafari = !Number.isNaN(safariVersion);
return (
// Safari has a bug with position: sticky and content editable, so we don't support it
!isBrowserSafari && isAnchorSupported() && isDragAndDropEnabled
);
};