Buttons in header do not always display as inline
The documentation says "
Each button is typically an
anchor
element, but any valid
button markup
will work. To save space, buttons in toolbars are set to
inline styling
so the button is only as wide as the text and icons it contains. " but that does not always seem to be true. I have this markup:
-
- <!DOCTYPE html>
- <html>
- <head>
- <title>jQuery Mobile button test</title>
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
- <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
- <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- </head>
- <body>
- <div data-role="page">
- <div data-role="header">
- <h1>Messages
- </h1>
- <button type="button">Button</button>
- </div>
- <div data-role="content">
- Stuff
- </div>
- </div>
- </body>
- </html>
-
And it seems like the button is taking up the full width of the header. I tried adding "data-inline='true'" to the button and it made it shrink to fit the text but it is still on a separate line. I am able to work around this problem by using an "a" element instead of a button but I am still wondering if this is a bug. I have included a screenshot showing what it looks like.
I only notice this in the stable release (1.1.1). I tried the alpha of 1.2.0 and I don't notice the problem. Is there any chance that this will be fixed in 1.1.1?