Skip to content

Commit 748c301

Browse files
authored
fix: forceRender not work (#256)
1 parent eac2f8f commit 748c301

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

src/Popup/PopupInner.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export interface PopupInnerProps {
2828
// Motion
2929
motion: CSSMotionProps;
3030
destroyPopupOnHide?: boolean;
31+
forceRender?: boolean;
32+
3133
// Legacy Motion
3234
animation: AnimationType;
3335
transitionName: TransitionNameType;
@@ -67,6 +69,7 @@ const PopupInner = React.forwardRef<PopupInnerRef, PopupInnerProps>(
6769

6870
stretch,
6971
destroyPopupOnHide,
72+
forceRender,
7073

7174
align,
7275
point,
@@ -194,6 +197,7 @@ const PopupInner = React.forwardRef<PopupInnerRef, PopupInnerProps>(
194197
onAppearPrepare={onShowPrepare}
195198
onEnterPrepare={onShowPrepare}
196199
removeOnLeave={destroyPopupOnHide}
200+
forceRender={forceRender}
197201
>
198202
{({ className: motionClassName, style: motionStyle }, motionRef) => {
199203
const mergedClassName = classNames(

src/Popup/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export interface PopupProps {
3838
// Motion
3939
motion: CSSMotionProps;
4040
maskMotion: CSSMotionProps;
41+
forceRender?: boolean;
4142

4243
// Legacy
4344
animation: AnimationType;

src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ export function generateTrigger(
510510
stretch,
511511
alignPoint,
512512
mobile,
513+
forceRender,
513514
} = this.props;
514515
const { popupVisible, point } = this.state;
515516

@@ -550,6 +551,7 @@ export function generateTrigger(
550551
ref={this.popupRef}
551552
motion={popupMotion}
552553
mobile={mobile}
554+
forceRender={forceRender}
553555
>
554556
{typeof popup === 'function' ? popup() : popup}
555557
</Popup>

tests/basic.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ describe('Trigger.Basic', () => {
275275
<span>Hey!</span>
276276
</Trigger>,
277277
);
278+
278279
expect(wrapper.instance().getPopupDomNode()).toBeFalsy();
279280
});
280281

0 commit comments

Comments
 (0)