]> cat aescling's git repositories - mastodon.git/commitdiff
Enable to handle app immediately after closing modal (#3082)
authorgeta6 <getakura@gmail.com>
Tue, 16 May 2017 10:12:38 +0000 (19:12 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Tue, 16 May 2017 10:12:38 +0000 (12:12 +0200)
app/javascript/mastodon/features/ui/components/modal_root.js

index 3596b2812c4c48697655431cb551d3972f97276e..c4015a119726952a01111bc543a9a909101cc916 100644 (file)
@@ -48,9 +48,10 @@ class ModalRoot extends React.PureComponent {
 
   render () {
     const { type, props, onClose } = this.props;
+    const visible = !!type;
     const items = [];
 
-    if (!!type) {
+    if (visible) {
       items.push({
         key: type,
         data: { type, props },
@@ -69,7 +70,7 @@ class ModalRoot extends React.PureComponent {
               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} />