diff --git a/src/controls/richText/RichText.tsx b/src/controls/richText/RichText.tsx index f696234d3..1b4fef19d 100644 --- a/src/controls/richText/RichText.tsx +++ b/src/controls/richText/RichText.tsx @@ -137,15 +137,15 @@ export class RichText extends React.Component { if (this.props.isEditMode) { document.addEventListener('click', this.handleClickOutside); document.addEventListener('focus', this.handleClickOutside); - } - const clientRect: ClientRect = this._wrapperRef.getBoundingClientRect(); - const parentClientRect: ClientRect = this._wrapperRef.parentElement.getBoundingClientRect(); - const toolbarTop: number = clientRect.top - parentClientRect.top - TOOLBARPADDING; + const clientRect: ClientRect = this._wrapperRef.getBoundingClientRect(); + const parentClientRect: ClientRect = this._wrapperRef.parentElement.getBoundingClientRect(); + const toolbarTop: number = clientRect.top - parentClientRect.top - TOOLBARPADDING; - this.setState({ - wrapperTop: toolbarTop - }); + this.setState({ + wrapperTop: toolbarTop + }); + } } /**