File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -118,11 +118,19 @@ async function emitTextPressEvents(
118118 await wait ( config ) ;
119119 dispatchEvent ( element , 'pressIn' , EventBuilder . Common . touch ( ) ) ;
120120
121- // Emit either `press` or `longPress`.
122- dispatchEvent ( element , options . type , EventBuilder . Common . touch ( ) ) ;
123-
124121 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+
125128 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+ }
126134}
127135
128136/**
You can’t perform that action at this time.
0 commit comments