Bug Tracker

Opened 7 years ago

Closed 7 years ago

#12169 closed bug (invalid)

live event in full screen

Reported by: sfornengo@… Owned by: sfornengo@…
Priority: undecided Milestone: None
Component: unfiled Version: 1.8rc1
Keywords: Cc:
Blocked by: Blocking:

Description

live event like: $(document).on("click",selector,funtion(){alert("coucou");}); no longer fire when toggled in full screen with elem.requestFullScreen()

but classic event like: $(selector).click(funtion(){alert("coucou");}); works as expected

I can not provide a jsfiddle because it does not support full screen api.

Change History (3)

comment:1 Changed 7 years ago by dmethvin

Owner: set to sfornengo@…
Status: newpending

no longer

Are you saying this is a regression in jQuery? It is hard to tell since there is no test case. We need a complete test case.

If it "no longer" works, perhaps Firefox changed?

https://bugzilla.mozilla.org/show_bug.cgi?id=703079

Since delegated events are caught for the elements *BELOW* the one where the handler is attached, attaching at document would be incorrect if the event is fired on document itself.

comment:2 Changed 7 years ago by anonymous

Sorry for my english (I am French ;)), the no longer isn't justified, this is not a regression in 1.8rc1, 1.7.2 doesn't work too. here is my test code:

<html>
    <head>
        <script src="http://code.jquery.com/jquery-1.8rc1.js"></script>
        <script>
            $(document).ready(function(){
                $("#gofull").click(function(){
                    var elem=$("#content")[0];
                    if(elem.requestFullScreen){ // w3c
                        elem.requestFullScreen();
                    }else if(elem.webkitRequestFullScreen){
                        elem.webkitRequestFullScreen();
                    }else if(elem.mozRequestFullScreen){
                        elem.mozRequestFullScreen();
                    }else{
                        alert("Full screen api unsupported by your browser");
                    }
                });
                $("#test1").click(function(){
                    alert("classic test ok");
                });
                $(document).on("click","#test2",function(){
                    alert("live test ok");
                });   
            });
        </script>
    </head>
    <body>
        <button id="gofull">go full screen</button>
        <div id="content">
            <button id="test1">classic test</button>
            <button id="test2">live test</button>
        </div>
    </body>
</html>

only the classic event survive to toggle the div id=content to full screen. I test under chrome and firefox, the live event doesn't fire in full screen mode. it doesn't seem to correspond to your suggered bug. pity that jsfiddle doesn't handle full screen api...

comment:3 Changed 7 years ago by dmethvin

Resolution: invalid
Status: pendingclosed

Please ask for help in the forum, since it doesn't look like this is a bug. This would be the expected behavior, for example, if the event is fired directly on document.

Note: See TracTickets for help on using tickets.