fscreen icon indicating copy to clipboard operation
fscreen copied to clipboard

fullscreenchange on Element not available in fscreen

Open richardbushell opened this issue 6 years ago • 4 comments
trafficstars

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.

richardbushell avatar Feb 26 '19 08:02 richardbushell

Good point. If you have time feel free to make a PR.

rafgraph avatar Jul 27 '19 13:07 rafgraph

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?

richardbushell avatar Jul 27 '19 14:07 richardbushell

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()]

rafgraph avatar Jul 27 '19 14:07 rafgraph

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?

richardbushell avatar Jul 27 '19 14:07 richardbushell