File tree Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -12,4 +12,12 @@ export default defineConfig({
1212 name : 'Trigger' ,
1313 logo : 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4' ,
1414 } ,
15+ styles : [
16+ `
17+ .dumi-default-previewer-demo {
18+ position: relative;
19+ min-height: 300px;
20+ }
21+ ` ,
22+ ]
1523} ) ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export default () => {
5151 return (
5252 < div
5353 style = { {
54- position : 'fixed ' ,
54+ position : 'absolute ' ,
5555 inset : 64 ,
5656 overflow : `auto` ,
5757 border : '1px solid red' ,
Original file line number Diff line number Diff line change @@ -121,7 +121,9 @@ export interface TriggerProps {
121121 // mobile?: MobileConfig;
122122}
123123
124- export function generateTrigger ( PortalComponent : React . ComponentType < any > = Portal ) {
124+ export function generateTrigger (
125+ PortalComponent : React . ComponentType < any > = Portal ,
126+ ) {
125127 const Trigger = React . forwardRef < TriggerRef , TriggerProps > ( ( props , ref ) => {
126128 const {
127129 prefixCls = 'rc-trigger-popup' ,
@@ -303,9 +305,13 @@ export function generateTrigger(PortalComponent: React.ComponentType<any> = Port
303305
304306 // ========================== Motion ============================
305307 const [ inMotion , setInMotion ] = React . useState ( false ) ;
308+ const mountRef = React . useRef ( true ) ;
306309
307310 useLayoutEffect ( ( ) => {
308- setInMotion ( true ) ;
311+ if ( ! mountRef . current || mergedOpen ) {
312+ setInMotion ( true ) ;
313+ }
314+ mountRef . current = true ;
309315 } , [ mergedOpen ] ) ;
310316
311317 const [ motionPrepareResolve , setMotionPrepareResolve ] =
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ describe('Trigger.Motion', () => {
3939 fireEvent . click ( target ) ;
4040
4141 expect ( document . querySelector ( '.rc-trigger-popup' ) ) . toHaveClass (
42- 'bamboo-enter ' ,
42+ 'bamboo-appear ' ,
4343 ) ;
4444
4545 expect (
You can’t perform that action at this time.
0 commit comments