File tree Expand file tree Collapse file tree 2 files changed +32
-8
lines changed
packages/selenium-ide/src/content Expand file tree Collapse file tree 2 files changed +32
-8
lines changed Original file line number Diff line number Diff line change @@ -534,8 +534,7 @@ Recorder.addEventHandler(
534534let nowNode = 0 ,
535535 mouseoverLocator ,
536536 nodeInsertedLocator ,
537- nodeAttrChange ,
538- nodeAttrChangeTimeout
537+ nodeInsertedAttrChange
539538Recorder . addEventHandler (
540539 'mouseOver' ,
541540 'mouseover' ,
@@ -546,14 +545,11 @@ Recorder.addEventHandler(
546545 let clickable = findClickableElement ( event . target )
547546 if ( clickable ) {
548547 nodeInsertedLocator = event . target
548+ nodeInsertedAttrChange = locatorBuilders . buildAll ( event . target )
549549 setTimeout ( ( ) => {
550550 nodeInsertedLocator = undefined
551+ nodeInsertedAttrChange = undefined
551552 } , 500 )
552-
553- nodeAttrChange = locatorBuilders . buildAll ( event . target )
554- nodeAttrChangeTimeout = setTimeout ( ( ) => {
555- nodeAttrChange = undefined
556- } , 10 )
557553 }
558554 //drop target overlapping
559555 if ( mouseoverQ ) {
@@ -629,9 +625,10 @@ Recorder.addMutationObserver(
629625 nodeInsertedLocator = undefined
630626 }
631627 if ( nodeInsertedLocator ) {
632- record ( 'mouseOver' , locatorBuilders . buildAll ( nodeInsertedLocator ) , '' )
628+ record ( 'mouseOver' , nodeInsertedAttrChange , '' )
633629 mouseoutLocator = nodeInsertedLocator
634630 nodeInsertedLocator = undefined
631+ nodeInsertedAttrChange = undefined
635632 mouseoverLocator = undefined
636633 }
637634 }
Original file line number Diff line number Diff line change 1+ < div id ="cont " style ="background: blue;width: 500px;height: 500px; " onclick ="javascript:void(0) ">
2+ </ div >
3+
4+ < script >
5+ const cont = document . getElementById ( 'cont' )
6+ const btn = document . createElement ( 'button' )
7+ btn . innerText = 'click me'
8+ let hasChild = false
9+ document . body . addEventListener ( 'mousemove' , ( ) => {
10+ } )
11+ cont . addEventListener ( 'mouseover' , ( ) => {
12+ console . log ( 'over' )
13+ if ( ! hasChild ) {
14+ cont . className = 'kaki'
15+ cont . appendChild ( btn )
16+ hasChild = true
17+ }
18+ } )
19+ cont . addEventListener ( 'mouseout' , ( ) => {
20+ console . log ( 'out' )
21+ if ( hasChild ) {
22+ cont . className = ''
23+ cont . removeChild ( btn )
24+ hasChild = false
25+ }
26+ } )
27+ </ script >
You can’t perform that action at this time.
0 commit comments