File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -87,21 +87,25 @@ bot.action.clear = function(element) {
87
87
'Element must be user-editable in order to clear it.' ) ;
88
88
}
89
89
90
- bot . action . LegacyDevice_ . focusOnElement ( element ) ;
91
90
if ( element . value ) {
91
+ bot . action . LegacyDevice_ . focusOnElement ( element ) ;
92
92
element . value = '' ;
93
93
bot . events . fire ( element , bot . events . EventType . CHANGE ) ;
94
+ bot . events . fire ( element , bot . events . EventType . BLUR ) ;
95
+ bot . action . LegacyDevice_ . focusOnElement ( document . body ) ;
94
96
} else if ( bot . dom . isElement ( element , goog . dom . TagName . INPUT ) &&
95
97
( element . getAttribute ( 'type' ) && element . getAttribute ( 'type' ) . toLowerCase ( ) == "number" ) ) {
96
98
// number input fields that have invalid inputs
97
99
// report their value as empty string with no way to tell if there is a
98
100
// current value or not
101
+ bot . action . LegacyDevice_ . focusOnElement ( element ) ;
99
102
element . value = '' ;
100
103
}
101
104
102
105
if ( bot . dom . isContentEditable ( element ) ) {
103
106
// A single space is required, if you put empty string here you'll not be
104
107
// able to interact with this element anymore in Firefox.
108
+ bot . action . LegacyDevice_ . focusOnElement ( element ) ;
105
109
element . innerHTML = ' ' ;
106
110
// contentEditable does not generate onchange event.
107
111
}
You can’t perform that action at this time.
0 commit comments