Radio button in jquery ui accordion header makes it not respond

I have a pretty simple jQuery accordion with radio buttons inside each title.

See JSFiddle

When I select a radio button, it should be checked and the accordion should open in that place. A strange problem is that the accordion opens, but the radio is not checked.

For me, this seems like a bug in jQuery-ui, any help would be appreciated.

<div class="accordion">
    <h3>
        test1
        <input type="radio" checked="checked" name="radio" />
    </h3>
    <div>
        content<br />
        content<br />
        content<br />
        content<br />
    </div>
    <h3>
        test2
        <input type="radio" name="radio" />
    </h3>
    <div>
        content<br />
        content<br />
        content<br />
        content<br />
    </div>
    <h3>
        test3
        <input type="radio" name="radio" />
    </h3>
    <div>
        content<br />
        content<br />
        content<br />
        content<br />
    </div>
</div>

JS:

$(".accordion").accordion()

As you can see it is about as simple as it can get ...

+3
source share
1 answer

, ( "click"), .preventDefault(), , :

$(".accordion").accordion({ event: "mouseup" });

.

+5

Source: https://habr.com/ru/post/1776451/


All Articles