New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data-role="none" buttons still enhanced when used in controlgroup #7676

Closed
adammessinger opened this Issue Sep 17, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@adammessinger

adammessinger commented Sep 17, 2014

My current project has a pagination control that includes a "self-submitting" select menu of pages and next/previous links. There's also a submit button with data-role="none" that's hidden if jQuery Mobile has enhanced the page. This is added so people without JS or using old browsers like IE 7 that jQM doesn't support can still submit the form to choose a page.

The data-role="none" button is still enhanced, despite being excluded using that data attribute. This is throwing off the formatting of the pagination control a bit on the last page. Demo/test page: http://jsbin.com/misihuqotunu/1/

For now, I'm getting around this by giving the next/prev links a class of "ui-state-disabled" on the first and last pages rather than excluding them.

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Sep 18, 2014

Contributor

You can fix this by using class ui-screen-hidden instead of jqm-hidden. When the controlgroup is instantiated, it attempts to determine the last visible button, but it cannot rely on the :visible selector, because the page itself is not yet visible, so all its elements are hidden. Thus, it falls back to checking for the presence of class ui-screen-hidden.

Contributor

gabrielschulhof commented Sep 18, 2014

You can fix this by using class ui-screen-hidden instead of jqm-hidden. When the controlgroup is instantiated, it attempts to determine the last visible button, but it cannot rely on the :visible selector, because the page itself is not yet visible, so all its elements are hidden. Thus, it falls back to checking for the presence of class ui-screen-hidden.

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Sep 18, 2014

Contributor

I'm still investigating why the button gets enhanced, though, because we should be filtering things that are supposed to stay native.

Contributor

gabrielschulhof commented Sep 18, 2014

I'm still investigating why the button gets enhanced, though, because we should be filtering things that are supposed to stay native.

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Sep 18, 2014

Contributor

Oh, but we're not filtering buttonMarkup() :/

Contributor

gabrielschulhof commented Sep 18, 2014

Oh, but we're not filtering buttonMarkup() :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment