File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
packages/react-headless/snackbar/src Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -100,12 +100,14 @@ function useSnackbarState({ pauseOnInteraction = true }: UseSnackbarStateProps)
100100 push ( option ) ;
101101 if ( state === "inactive" ) {
102102 pop ( ) ;
103+ console . log ( "push" ) ;
103104 setState ( "active" ) ;
104105 }
105106 } ,
106107 pause : ( ) => {
107108 if ( state === "active" ) {
108109 if ( pauseOnInteraction ) {
110+ console . log ( "pause" ) ;
109111 setState ( "persist" ) ;
110112 }
111113 }
@@ -160,9 +162,11 @@ export function useSnackbar(props: UseSnackbarProps) {
160162 safeOffset,
161163
162164 create ( options : CreateSnackbarOptions ) {
165+ console . log ( "create happened, pushing..." ) ;
163166 events . push ( options ) ;
164167 } ,
165168 dismiss ( ) {
169+ console . log ( "dismiss happened, dismissing..." ) ;
166170 events . dismiss ( ) ;
167171 } ,
168172
@@ -197,23 +201,28 @@ export function useSnackbar(props: UseSnackbarProps) {
197201
198202 // only pause if focus is visible (focused using keyboard) || action label has focus
199203 if ( event . target . matches ( ":focus-visible" ) ) {
204+ console . log ( "focus - pausing" ) ;
200205 events . pause ( ) ;
201206 }
202207 } ,
203208 onBlur ( ) {
209+ console . log ( "blur - resuming" ) ;
204210 events . resume ( ) ;
205211 } ,
206212 onPointerEnter ( ) {
213+ console . log ( "pointer enter - pausing" ) ;
207214 events . pause ( ) ;
208215 } ,
209216 onPointerLeave ( ) {
217+ console . log ( "pointer leave - resuming" ) ;
210218 events . resume ( ) ;
211219 } ,
212220 } ) ,
213221
214222 closeButtonProps : buttonProps ( {
215223 type : "button" ,
216224 onClick ( ) {
225+ console . log ( "close button clicked - dismissing" ) ;
217226 events . dismiss ( ) ;
218227 } ,
219228 } ) ,
You can’t perform that action at this time.
0 commit comments