box-annotations 5.2.1-beta.17 → 5.2.1-beta.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "box-annotations",
3
- "version": "5.2.1-beta.17",
3
+ "version": "5.2.1-beta.18",
4
4
  "description": "Box Annotations",
5
5
  "author": "Box (https://www.box.com/)",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -179,8 +179,8 @@ const DrawingAnnotations = (props: Props): JSX.Element => {
179
179
  />
180
180
  )}
181
181
 
182
- {isCreating && hasPathGroups && drawingSVGGroup && canShowPopupToolbar && popupPortalEl &&
183
- ReactDOM.createPortal(
182
+ {isCreating && hasPathGroups && drawingSVGGroup && canShowPopupToolbar && (() => {
183
+ const toolbar = (
184
184
  <PopupDrawingToolbar
185
185
  ref={popupDrawingToolbarRef}
186
186
  canComment={hasDrawnPathGroups}
@@ -192,9 +192,10 @@ const DrawingAnnotations = (props: Props): JSX.Element => {
192
192
  onReply={handleReply}
193
193
  onUndo={handleUndo}
194
194
  reference={drawingSVGGroup}
195
- />,
196
- popupPortalEl,
197
- )}
195
+ />
196
+ );
197
+ return popupPortalEl ? ReactDOM.createPortal(toolbar, popupPortalEl) : toolbar;
198
+ })()}
198
199
  </>
199
200
  );
200
201
  };