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
In recent exploration with jsdom it's become quite clear that Tallahassee has taken some freedom in how events are being fired when used programmatically.
Example: input.value = "abc" contrary to popular belief does not actually fire any events like input. If the user actually types in the input, then it will be fired. jsdom behaves this way correctly.
Instead of overriding that behaviour (because tinkering with the value property on <input> elements is a slippery slope) it feels safer (and better all around) to instead have an interface where you can interact with an element.
So some suggestions!
input.userType("abc")
Sets value and fires relevant events connected to that change. Requires an override on the element prototype itself to provide this.
browser.userType(input, "abc")
Keeps the event on the browser object provided by Tallahassee and makes it much clearer where the main API resides, which is the browser instance returned from new Tallahassee()
The text was updated successfully, but these errors were encountered:
Regardless, all of this mimics the behaviour from other popular libraries such as user-event and can such either be provided in Tallahassee itself, or recommended to use with (since it already works on top of jsdom)
In recent exploration with
jsdom
it's become quite clear that Tallahassee has taken some freedom in how events are being fired when used programmatically.Example:
input.value = "abc"
contrary to popular belief does not actually fire any events likeinput
. If the user actually types in the input, then it will be fired.jsdom
behaves this way correctly.Instead of overriding that behaviour (because tinkering with the
value
property on<input>
elements is a slippery slope) it feels safer (and better all around) to instead have an interface where you can interact with an element.So some suggestions!
input.userType("abc")
Sets
value
and fires relevant events connected to that change. Requires an override on the element prototype itself to provide this.browser.userType(input, "abc")
Keeps the event on the browser object provided by Tallahassee and makes it much clearer where the main API resides, which is the
browser
instance returned fromnew Tallahassee()
The text was updated successfully, but these errors were encountered: