File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -118,11 +118,19 @@ async function emitTextPressEvents(
118
118
await wait ( config ) ;
119
119
dispatchEvent ( element , 'pressIn' , EventBuilder . Common . touch ( ) ) ;
120
120
121
- // Emit either `press` or `longPress`.
122
- dispatchEvent ( element , options . type , EventBuilder . Common . touch ( ) ) ;
123
-
124
121
await wait ( config , options . duration ) ;
122
+
123
+ // Long press events are emitted before `pressOut`.
124
+ if ( options . type === 'longPress' ) {
125
+ dispatchEvent ( element , 'longPress' , EventBuilder . Common . touch ( ) ) ;
126
+ }
127
+
125
128
dispatchEvent ( element , 'pressOut' , EventBuilder . Common . touch ( ) ) ;
129
+
130
+ // Regular press events are emitted after `pressOut`.
131
+ if ( options . type === 'press' ) {
132
+ dispatchEvent ( element , 'press' , EventBuilder . Common . touch ( ) ) ;
133
+ }
126
134
}
127
135
128
136
/**
You can’t perform that action at this time.
0 commit comments