You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue with the .setText method on the WebElement. It is using the .clear method.
Based on this resource:
Note that the events fired by this event may not be as you'd expect. In particular, we don't fire any keyboard or mouse events
Considering an input field. The .clear() method will do a simple operation element.value = '', but it will not fire any events so that the application internal state will change. The way React works is it will use the state (which is stored in-memory) and update the nodes with it.
At some point it will rerender everything; this means that the state is now back to the one we have in memory.
There is a delay(100) and a series of keystrokes: CTRL+A and then DELETE. The field currently has no value (since .clear was called) and no event will be fired again (because it's already empty).
If we adapt the code to not use .clear this would result in an "change" event where we could now listen to and update the internal state with "" as the value of the input.
This also means that we can remove those hackish delays as well.
I can make a PR to fix this; just let me know.
Cheers.
The text was updated successfully, but these errors were encountered:
There is an issue with the
.setText
method on the WebElement. It is using the .clear method.Based on this resource:
Considering an input field. The
.clear()
method will do a simple operationelement.value = ''
, but it will not fire any events so that the application internal state will change. The way React works is it will use the state (which is stored in-memory) and update the nodes with it.At some point it will rerender everything; this means that the state is now back to the one we have in memory.
There is a delay(100) and a series of keystrokes: CTRL+A and then DELETE. The field currently has no value (since .clear was called) and no event will be fired again (because it's already empty).
If we adapt the code to not use .clear this would result in an "change" event where we could now listen to and update the internal state with
""
as the value of the input.This also means that we can remove those hackish delays as well.
I can make a PR to fix this; just let me know.
Cheers.
The text was updated successfully, but these errors were encountered: