Skip to content

Support Radio Input Label for Attribute #667

Open
@onet4

Description

@onet4

Nice plugin.

When I create a menu with radio inputs, clicking on the radio label text does not check the radio button for the first time. Multiple clicks seem to be required.

My suggestion is to give those radio buttons the temporary id attribute and set the for attribute to the label tag with the value of the radio id.

I did this with the show callback but the menu started moving jittery. So it should be better built-in.

events: {
    show: function(opt) {
        var $this = this;   
        opt.$menu.find( 'input[type=radio]' ).each( function( index, value ){
            var _id = 'context-menu-radio-' + index;
            $( this ).attr( 'id', _id );
            $( this ).parent().attr( 'for', _id ); // label tag misses the for attribute
        } );
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions