fscreen
fscreen copied to clipboard
fullscreenchange on Element not available in fscreen
Excellent library, thanks. The Fullscreen API also supports fullscreenchange event directly on an Element (not just on the Document), it would be great to add this to fscreen, as I believe that is currently missing.
Good point. If you have time feel free to make a PR.
Logically I have implemented this locally using:-
addEventListener: (element, type, handler, options) => element.addEventListener(vendor[key[type]], handler, options)
BUT I presume introducing a new initial ELEMENT parameter would represent a breaking change?
That would be a breaking change, but I think it makes sense.. unless you have another idea.
Also the fscreen.onfullscreenchange and fscreen.onfullscreenerror would need to be updated too.. I'm thinking remove the getter and setters and have the api be fscreen.onfullscreenchange(element) = handler which could be implemented as:
onfullscreenchange: element => element[`on${vendor[key.fullscreenchange]}`.toLowerCase()]
I agree that it makes sense too, and your solution seems the best way of implementing this. Are you OK to make your suggested revisions directly?