-
-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow click
, doubleClick
, and triggerEvent
to trigger events on window
.
#943
Conversation
We should evaluate the other DOM helpers, see which should allow |
@rwjblue I did. It looks as though |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've labeled this as breaking
, but how is it breaking? It seems that we are widening the types / allowed values (you can now do a thing you couldn't before), no?
click
, doubleClick
, and triggerEvent
to trigger events on window
.
During a refactor that improved typings in this project, the
getElement
function was narrowed in what it would return - specifically it was correctly fixed to return elements, of whichwindow
is not. This had the side effect of removing support for triggering window events viatriggerEvent
, in addition to removing support for other helpers.This PR restores that capability by adding a new
getTarget
util, which wraps thegetElement
util but additionally checks for the presence of window, and subsequently returns that in favor of an element.TODO:
Update
getElement
calls in other helpers that are valid forwindow
:triggerEvent
click
doubleClick