From 70ea74709ffcf68f2d1f8b0aa85f1d49d4f70afc Mon Sep 17 00:00:00 2001 From: Dominic Go <18517029+dominicstop@users.noreply.github.com> Date: Tue, 6 Feb 2024 21:24:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AB=20Update:=20`ContextMenuView`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContextMenuView/ContextMenuView.tsx | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/components/ContextMenuView/ContextMenuView.tsx b/src/components/ContextMenuView/ContextMenuView.tsx index ab96508f..f88354ff 100644 --- a/src/components/ContextMenuView/ContextMenuView.tsx +++ b/src/components/ContextMenuView/ContextMenuView.tsx @@ -37,7 +37,7 @@ export class ContextMenuView extends super(props); this.state = { - menuVisible : false, + menuVisible: false, mountPreview: false, }; @@ -119,7 +119,7 @@ export class ContextMenuView extends shouldPreventLongPressGestureFromPropagating ?? true ), debugShouldEnableLogging: ( - debugShouldEnableLogging ?? true + debugShouldEnableLogging ?? LIB_ENV.shouldEnableLogging ), // B. Pass down props... @@ -226,17 +226,17 @@ export class ContextMenuView extends this.props.onMenuWillShow?.(event); event.stopPropagation(); - this.setState({menuVisible: true}); + this.setState({ + menuVisible: true, + mountPreview: true, + }); }; private _handleOnMenuWillHide: OnMenuWillHideEvent = (event) => { this.props.onMenuWillHide?.(event); event.stopPropagation(); - this.setState({ - menuVisible : false, - mountPreview: false, - }); + this.setState({menuVisible : false}); }; private _handleOnMenuWillCancel: OnMenuWillCancelEvent = (event) => { @@ -255,6 +255,8 @@ export class ContextMenuView extends event.stopPropagation(); event.persist(); + + this.setState({mountPreview : false}); }; private _handleOnMenuDidCancel: OnMenuDidCancelEvent = (event) => { @@ -406,9 +408,7 @@ export class ContextMenuView extends {shouldMountPreviewContainer && ( {shouldMountPreviewContent && ( props.renderProps.renderPreview?.() @@ -418,9 +418,7 @@ export class ContextMenuView extends {shouldMountAuxPreviewContainer && ( {shouldMountAuxPreviewContent && ( props.renderProps.renderAuxillaryPreview?.()