@@ -77,14 +77,14 @@ function PlainCollapsible(props: { defaultOpen?: boolean; keepMounted?: boolean
77
77
if ( ! shouldCancelInitialOpenTransitionRef . current && ! keepMounted ) {
78
78
// the closed transition styles must be set here to transition the first
79
79
// opening transition when the panel is BOTH initially closed AND `keepMounted={false}`
80
- console . log ( 'handlePanelRef setting opacity 0' ) ;
81
- element . style . opacity = '0' ;
80
+ // console.log('handlePanelRef setting opacity 0');
81
+ // element.style.opacity = '0';
82
82
83
83
setHeightAndRemoveDisplayProperty ( element ) ;
84
84
85
85
// after setHeight() all the transition properties need to be removed
86
- console . log ( 'handlePanelRef unsetting inline opacity' ) ;
87
- element . style . removeProperty ( 'opacity' ) ;
86
+ // console.log('handlePanelRef unsetting inline opacity');
87
+ // element.style.removeProperty('opacity');
88
88
} else {
89
89
setHeightAndRemoveDisplayProperty ( element ) ;
90
90
}
@@ -95,9 +95,11 @@ function PlainCollapsible(props: { defaultOpen?: boolean; keepMounted?: boolean
95
95
}
96
96
97
97
requestAnimationFrame ( ( ) => {
98
- setTimeout ( ( ) => {
99
- element . style . removeProperty ( 'transition-duration' ) ;
100
- shouldCancelInitialOpenTransitionRef . current = false ;
98
+ shouldCancelInitialOpenTransitionRef . current = false ;
99
+ requestAnimationFrame ( ( ) => {
100
+ setTimeout ( ( ) => {
101
+ element . style . removeProperty ( 'transition-duration' ) ;
102
+ } ) ;
101
103
} ) ;
102
104
} ) ;
103
105
} ) ;
@@ -182,8 +184,8 @@ function PlainCollapsible(props: { defaultOpen?: boolean; keepMounted?: boolean
182
184
// the closed transition styles must be set here to transition all opening
183
185
// transitions except the first one when `keepMounted={false}`
184
186
if ( ! shouldCancelInitialOpenTransitionRef . current ) {
185
- console . log ( 'useEnhancedEffect setting opacity 0' ) ;
186
- panel . style . opacity = '0' ;
187
+ // console.log('useEnhancedEffect setting opacity 0');
188
+ // panel.style.opacity = '0';
187
189
}
188
190
189
191
requestAnimationFrame ( ( ) => {
@@ -195,8 +197,8 @@ function PlainCollapsible(props: { defaultOpen?: boolean; keepMounted?: boolean
195
197
196
198
if ( ! shouldCancelInitialOpenTransitionRef . current ) {
197
199
// remove all the transition properties that were just manually applied
198
- console . log ( 'useEnhancedEffect unsetting inline opacity' ) ;
199
- panel . style . removeProperty ( 'opacity' ) ;
200
+ // console.log('useEnhancedEffect unsetting inline opacity');
201
+ // panel.style.removeProperty('opacity');
200
202
}
201
203
202
204
setHeight ( panel . scrollHeight ) ;
0 commit comments