Skip to content
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

fix event.relatedTarget fallback logic for firefox #19607

Merged
merged 2 commits into from
Aug 14, 2020
Merged

fix event.relatedTarget fallback logic for firefox #19607

merged 2 commits into from
Aug 14, 2020

Conversation

claytercek
Copy link
Contributor

@claytercek claytercek commented Aug 13, 2020

Summary

Fixed a bug where if the nativeEvent relatedTarget property was null in Firefox, it would return undefined.

Issue: #19572

Test Plan

Tested on Firefox 79, now returns null if nativeEvent is null.

Tested in the following environments to make sure behavior was unaffected and no new bugs were introduced:

  • IE11 - windows
  • Edge 84 - windows
  • Opera 69 - mac
  • Chrome 84 - mac
  • Safari 13 - mac

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 13, 2020

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.

Latest deployment of this branch, based on commit ccdf9c2:

Sandbox Source
React Configuration

@sizebot
Copy link

sizebot commented Aug 13, 2020

No significant bundle size changes to report.

Size changes (experimental)

Generated by 🚫 dangerJS against ccdf9c2

@sizebot
Copy link

sizebot commented Aug 13, 2020

No significant bundle size changes to report.

Size changes (stable)

Generated by 🚫 dangerJS against ccdf9c2

@gaearon
Copy link
Collaborator

gaearon commented Aug 13, 2020

Does the new check work as you expect for all browsers?

@claytercek
Copy link
Contributor Author

yes! It will return null if the nativeEvent is null, otherwise it returns the relevant element.

This was referenced Mar 15, 2021
koto pushed a commit to koto/react that referenced this pull request Jun 15, 2021
* fix event.relatedTarget fallback logic for firefox

* check if relatedTarget is undefined for fallback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants