render () {
const { type, props, onClose } = this.props;
+ const visible = !!type;
const items = [];
- if (!!type) {
+ if (visible) {
items.push({
key: type,
data: { type, props },
const SpecificComponent = MODAL_COMPONENTS[type];
return (
- <div key={key}>
+ <div key={key} style={{ pointerEvents: visible ? 'auto' : 'none' }}>
<div role='presentation' className='modal-root__overlay' style={{ opacity: style.opacity }} onClick={onClose} />
<div className='modal-root__container' style={{ opacity: style.opacity, transform: `translateZ(0px) scale(${style.scale})` }}>
<SpecificComponent {...props} onClose={onClose} />