From 2ccce1a67ef84723d047a8f2db6dce8201353d0f Mon Sep 17 00:00:00 2001 From: Mikkel Laursen Date: Thu, 9 Nov 2017 11:42:31 -0700 Subject: [PATCH] Fixed the infinite Dialog Content max-height toggling It should ave been scrollHeight instead of height for an equality check. --- src/js/Dialogs/Dialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/Dialogs/Dialog.js b/src/js/Dialogs/Dialog.js index 880c872d14..da4a950c38 100644 --- a/src/js/Dialogs/Dialog.js +++ b/src/js/Dialogs/Dialog.js @@ -353,7 +353,7 @@ export default class Dialog extends PureComponent { } }; - _handleContentResize = ({ height, el: content }) => { + _handleContentResize = ({ scrollHeight, el: content }) => { const maxHeight = content.style.maxHeight; const dialog = content.parentNode; content.style.maxHeight = 'none'; @@ -362,7 +362,7 @@ export default class Dialog extends PureComponent { const totalHeight = dialog.offsetHeight - (title ? title.offsetHeight : 0) - (footer ? footer.offsetHeight : 0); content.style.maxHeight = maxHeight; - const equalHeight = totalHeight === height; + const equalHeight = totalHeight === scrollHeight; if (equalHeight) { if (this.state.contentStyles && this.state.contentStyles.maxHeight) { this.setState({ contentStyles: this.props.contentStyle });