From d5343dfb01854635df2ac66a6ea13ce3486270b2 Mon Sep 17 00:00:00 2001 From: Benjamin Wheeler Date: Thu, 11 Oct 2018 16:58:30 -0400 Subject: [PATCH] fix ReactModal bodyOpenClassName error so that it is entirely omitted, rather than passing null value (#2176) --- src/components/modal/base/modal.jsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/modal/base/modal.jsx b/src/components/modal/base/modal.jsx index 98d4a9977..156d435ce 100644 --- a/src/components/modal/base/modal.jsx +++ b/src/components/modal/base/modal.jsx @@ -23,14 +23,15 @@ class Modal extends React.Component { return this.modal.portal.requestClose(); } render () { + // bodyOpenClassName prop cannot be blank string or null here; both cause + // an error, because ReactModal does not correctly handle them. + // If we're not setting it to a class name, we must omit the prop entirely. + const bodyOpenClassNameProp = this.props.useStandardSizes ? + {bodyOpenClassName: classNames('overflow-hidden')} : {}; return (