-
Notifications
You must be signed in to change notification settings - Fork 2.4k
No visual feedback given when pressing a button/stylished link #4469
Comments
In general buttons with href="#" get the hover and down style, so there must be something else in play. |
Sure, here is an example. Please note that the "bug" happens when using an iPhone (and afaik, on other mobile devices too). I had no issues with Firefox for OS X. |
@janimattiellonen Thanks a lot for the test page. |
At first I thought you meant the button didn't get the "down" state (dark gray in your example) on iPhone 4 but @agcolom tested this and that is not an issue. So I suppose with "visual feedback" you mean the "active state" (blue in your example). The button gets the active state when there is an action in progress. In your example the first button contains a function, which means there is an action and the button gets the active state. With the second button there is no action so also no active state. This is expected behaviour, yes. What I still don't understand is what difference you see between FF and iPhone4. Maybe you can clarify this. Thanks! |
@uGoMobi oops sorry, no on the iPod Touch the button doesn't get the down effect either... sorry |
See http://jsbin.com/otepum/80 When pressing the bottom button quickly (tapping) on an iPhone 4, a random value is rendered in the dedicated (as a visual indicator that an event is actually triggered). However, the button gives no visual feedback to the user that it was actually pressed/tapped.
When tapping the upper button, the button's background color is changed for a moment to blue and then back to the original color. THIS IS what I want to happen for the bottom button. In my web app I mainly deal with button events using javascript and AJAX and I do not want clicking of certain buttons to cause a page load. I guess I could use javascript:void(0) instead of # as the value for the href attribute. Allthough it looks bad ;) (Hmm, apparently I don't have to call $(this).button('refresh'); which I first was certain I had to) |
I now understand, after the update from @agcolom, that you don't see the "down state" either. This has to do with buttonMarkup.hoverDelay. You can read more about this on this page in the docs http://jquerymobile.com/test/docs/api/globalconfig.html
Default is 200 and I changed it to 100, but you can play with it to see what works best. Regarding the active state. You could still use href="#" but then you need to make your function add and remove the active class.
As an alternative you could change the styling of the down state to make that look like the active state. Buttons with href="#" don't get active state by design, this is not a bug. Maybe we have to give the default value for hoverDelay another look. Closing for now, but feel free to comment if the suggestions above doesn't solve your issue. |
Thanks for your replies and the offered solution. I will try it out later. |
You are welcome. BTW - We are considering to make changes so buttons always show active state when pressed to improve the visual feedback. Stay tuned! |
Forgot to reply. When using $.mobile.buttonMarkup.hoverDelay = 100; it started to work better. Thanks. |
Let me share this neither of them worked for me. Need your thoughts on this.
Its just that the button doesnt show the active state. This is my button. anchor tag href="#" data-transition="none" id="WoBackbutton" data-icon="back" onclick="WorkOrder.updateBackData()" class="ui-btn-left">Back</a Using jquery mobile 1.4.5 on android 4.1.2. |
If an element stylished as a button has href="#" then tapping the button yields no visual feedback to the user, even if the tap was registered. In my app I use javascript to render html views and the lack of visual feedback degrades user experience quite a lot.
I can reproduce this on my iPhone 4.
Is this expected behaviour?
I'm using jquerymobile 1.1.0 and jquery 1.7.1.
The following code generates visual feedback when I tap the button on my iPhone 4:
The text was updated successfully, but these errors were encountered: