views:

9

answers:

0

The escape button seems to be broken when you expand/collapse any of the content at least once. The escape button triggers fine if you do not expand/collapse any of the content. This issue holds true when using jQuery-UI dialog as well.

Is there a way to resolve the issue with the escape button not closing the dialog/modal?

<iframe src="accordion.html" width="100%" height="100%" id="myframe" name="myframe"></iframe>
<script type="text/javascript">
$(function(){
    $("#myframe").modal({
        opacity: 80,
        overlayClose: true,
        containerCss: {
            height: 500,
            width: 700
        },
        escClose: true
    });
});
</script>

This was used to test jQuery UI dialog:

$("#myframe").dialog({
    height: 500,
    width: 800,
    modal: true,
    closeOnEscape: true
});

In accordion.html I copied the example from jQuery-UI so nothing fancy here.

<div id="accordion">
<h3><a href="#">Section 1</a></h3>
    <div>
        <p>
        Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer
        ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit
        amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut
        odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.
        </p>
    </div>
    <h3><a href="#">Section 2</a></h3>
    <div>
        <p>
        Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet
        purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor
        velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In
        suscipit faucibus urna.
        </p>
    </div>
    <h3><a href="#">Section 3</a></h3>
    <div>
        <p>
        Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis.
        Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero
        ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis
        lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.
        </p>
        <ul>
            <li>List item one</li>
            <li>List item two</li>
            <li>List item three</li>
        </ul>
    </div>
    <h3><a href="#">Section 4</a></h3>
    <div>
        <p>
        Cras dictum. Pellentesque habitant morbi tristique senectus et netus
        et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in
        faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia
        mauris vel est.
        </p>
        <p>
        Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus.
        Class aptent taciti sociosqu ad litora torquent per conubia nostra, per
        inceptos himenaeos.
        </p>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        $("#accordion").accordion();
    });
</script>