If I have a link in my jQuery Mobile app, and make it a button with .button();. If I click on the text (center of the button), it will not throw the event “click”.
Here is an example:
http://jsfiddle.net/9rZHg/
Run this script, and try aiming for the text. The alert popup will not show up. It will work only if you click on other parts of the button.
The same occurs while testing on the device.
Is there an easy way to avoid this, or do I have to use <button> tags everywhere in my app ?
Thank you
Developer on the jQuery Mobile project, here.
While the fix above may temporarily patch the issue for the time being, the fundamental issue is that the
button()plugin is intended forbuttonelements and inputs. Adding thedata-role="button"attribute or calling thebuttonMarkup()plugin instead will prevent this issue.