Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

CSS class is not copied from <select> tag to a button element #5308

Closed
skozyr opened this issue Nov 20, 2012 · 1 comment
Closed

CSS class is not copied from <select> tag to a button element #5308

skozyr opened this issue Nov 20, 2012 · 1 comment

Comments

@skozyr
Copy link

skozyr commented Nov 20, 2012

If one create Select component with a custom CSS class:

<select id="s1" data-theme='a' data-icon='forward' data-native-menu="false" tabIndex="1" class='customclass'>
    <option value='Veni' selected="selected">
        Veni
    </option>
    <option value='Vidi'>
        Vidi
    </option>
    <option value='Vici'>
        Vici
    </option>
</select>

Sample

Then JQM wraps this <select> component and creates <a ...> element before it.
See jquery.mobile-1.2.0.js at lines 8054-8065

button = this.button
    .insertBefore( this.select )
    .buttonMarkup( {
        theme: options.theme,
        icon: options.icon,
        iconpos: iconpos,
        inline: inline,
        corners: options.corners,
        shadow: options.shadow,
        iconshadow: options.iconshadow,
        mini: mini
    });

But unfortunately class assigned to original <select > element is not copied to button. JQM creates <a ...> element without class "customclass".
I think this is wrong behavior. It could be fixed adding

button.addClass( this.select.getAttr('class') );

after line 8065 in jquery.mobile-1.2.0.js

@jaspermdegroot
Copy link
Contributor

@skozyr

Thanks for reporting the issue. We are aware of this problem and looking into a solution. I am closing this ticket as duplicate of #3577.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants