Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
style: {
overflow: container.style.overflow,
paddingRight: container.style.paddingRight
}
};
let style = {
overflow: 'hidden'
};
data.overflowing = isOverflowing(container);
if (data.overflowing) {
// use computed style, here to get the real padding
// to add our scrollbar width
style.paddingRight = parseInt(addStyle(container, 'paddingRight') || 0, 10) + getScrollbarSize() + 'px';
}
addStyle(container, style);
data.classes.forEach(addClass.bind(null, container));
this.containers.push(container);
this.data.push(data);
return modalIdx;
}
getStyles(dialogElement?: HTMLElement) {
const { container, overflow, drawer } = this.props;
const node: any = dialogElement || this.dialogRef.current;
const doc: any = ownerDocument(node);
const scrollHeight = node ? node.scrollHeight : 0;
const bodyIsOverflowing = isOverflowing(container || doc.body);
const modalIsOverflowing = scrollHeight > doc.documentElement.clientHeight;
const styles: {
modalStyles: React.CSSProperties;
bodyStyles: React.CSSProperties;
} = {
modalStyles: {
[isRTL() ? 'paddingLeft' : 'paddingRight']:
bodyIsOverflowing && !modalIsOverflowing ? getScrollbarSize() : 0,
[isRTL() ? 'paddingRight' : 'paddingLeft']:
!bodyIsOverflowing && modalIsOverflowing ? getScrollbarSize() : 0
},
bodyStyles: {}
};
if (!overflow) {
return styles;
}
const bodyStyles: React.CSSProperties = {
overflow: 'auto'
};
if (node) {
// default margin
const node: any = dialogElement || this.dialogRef.current;
const doc: any = ownerDocument(node);
const scrollHeight = node ? node.scrollHeight : 0;
const bodyIsOverflowing = isOverflowing(container || doc.body);
const modalIsOverflowing = scrollHeight > doc.documentElement.clientHeight;
const styles: {
modalStyles: React.CSSProperties;
bodyStyles: React.CSSProperties;
} = {
modalStyles: {
[isRTL() ? 'paddingLeft' : 'paddingRight']:
bodyIsOverflowing && !modalIsOverflowing ? getScrollbarSize() : 0,
[isRTL() ? 'paddingRight' : 'paddingLeft']:
!bodyIsOverflowing && modalIsOverflowing ? getScrollbarSize() : 0
},
bodyStyles: {}
};
if (!overflow) {
return styles;
}
const bodyStyles: React.CSSProperties = {
overflow: 'auto'
};
if (node) {
// default margin
let headerHeight = 46;
let footerHeight = 46;