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

event.relatedTarget is undefined on Firefox #2024

Closed
mischizzle opened this issue Apr 8, 2015 · 4 comments
Closed

event.relatedTarget is undefined on Firefox #2024

mischizzle opened this issue Apr 8, 2015 · 4 comments

Comments

@mischizzle
Copy link
Contributor

In src/js/events.js we create the relatedTarget like this (line 55)

// Handle which other element the event is related to
event.relatedTarget = event.fromElement === event.target ?
  event.toElement :
  event.fromElement;

The problem is that Firefox does not support event.fromElement. Therefore the above code will overwrite the correct relatedTarget with undefined.

Fix: Firefox does support relatedTarget (https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/relatedTarget). So it simply needs to check the existence of this property before setting it.

note: This issue has already been discussed in ES6ification pull request (https://github.com/videojs/video.js/pull/1976/files#r27894428).

@heff
Copy link
Member

heff commented Apr 8, 2015

👍 Want to make a pull request for it?

@mischizzle
Copy link
Contributor Author

Yep - working on it now :)

mischizzle pushed a commit to mischizzle/video.js that referenced this issue Apr 9, 2015
@mischizzle
Copy link
Contributor Author

Tried to use contrib feature submit to do the pull request but ended up getting undefined so instead created it manually #2025

@heff
Copy link
Member

heff commented Apr 9, 2015

Bah, sorry. The contrib steps are out of date.

On Thu, Apr 9, 2015 at 6:17 AM, Michelle Anderson notifications@github.com
wrote:

Tried to use contrib feature submit to do the pull request but ended up
getting undefined so instead created it manually #2025
#2025


Reply to this email directly or view it on GitHub
#2024 (comment).

mischizzle pushed a commit to mischizzle/video.js that referenced this issue Apr 13, 2015
@heff heff closed this as completed in 3479a54 Jul 9, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants