call initUIEvent with the correct view - #1306
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
|
Logged a bug against Chrome https://issues.chromium.org/issues/545322457 microsoft/fluentui#20022 (comment) suggests that this should be fixed at the jsdom level. I'm not entirely sure yet if I agree. jsdom doesn't deal in trusted events (except for focus/blur, i'm not sure why), and only in trusted events is the User event would be the level at which to set trusted, but I think that's likely a large undertaking and isn't something I wish to take on right now. But adding the view at this level does seem correct as we can think of the user event flows as trusted. If you'd like to open an issue with jsdom, we could see what they have to say as well. I've pushed some tests for this that I was working on while getting up to speed. |
What
We need to pass window to the UIEvent constructor otherwise
event.viewwill be undefined in the emitted event.Why
This should fix this erroneously closed issue.
We rely on
event.viewbeing defined inside React Flow. This would also fix issues with testingd3-drag.How
Always pass
view: windowalong with the init parameters.Checklist