-
Notifications
You must be signed in to change notification settings - Fork 2.4k
All buttons regardless of markup should get active state #5009
Comments
@kvedananda - This is indeed something we want to improve. See the thread of #4469 for work arounds. @toddparker - Is applying the active state to all buttons, regardless of markup, something we can add for 1.3? |
Absolutely. We've been adding active state feedback wherever we can to improve perceived responsiveness. We just need to make sure to pull this class after a brief delay to ensure they are cleaned up. |
Great thanks guys. Setting the href to javascript:void(0) as described in #4469 works for now. |
Closing this as feature request and I added a link to this ticket here https://github.com/jquery/jquery-mobile/wiki/Feature-Requests |
Oops. Since this will be for 1.3 I better leave it open. |
I changed the topic of this ticket (was: "Unlinked buttons don't display click/tap animation"). Things to look into:
Update:
|
Related PR: #5145 |
The problem is that we only add the active class to buttons for which we know that clicking on them will not result in the current instance of jQM being scrapped. That is, we only do the logic for buttons that result in navigation that's done internally. The reason for this is that we cannot remove the active class off buttons that, when clicked, lead to a page accessed over HTTP, because the request causes the whole browser state to be scrapped, including our logic to remove the active class upon the next button click. So, if the user were then to hit "Back", she would be taken back to the page where the button still has the active state applied. Not only that, but, if she were to click on yet another button on that page, which also leads to a HTTP request, that button would also have the active state upon her return. This would basically result in visual artifacts. |
@gabrielschulhof can't the buttons state be reset on unload? |
After a discussion with @uGoMobi we've come up with two possible solutions for adding active states to those buttons (be they links or form elements) that will cause the browser to tear down all of jQM as it shows a page via an HTTP request.
|
Just a small note on the |
… via AJAX. Addresses parts of #5009.
OK, so we decided that #5337 is as far as we'll go. We're not gonna handle the case of links/buttons that result in HTTP requests. Feel free to re-open if you find another instance where internal navigation needs to result in a button that receives the active state right after it gets tapped on. Otherwise, feel free to drop us a PR for the HTTP navigation case. |
When I click a button like this
it works fine.
However this
does not work. It fires the tap event but does not change css to the tapped state and then back to normal.
It appears that only buttons that are either linked to another page or buttons that submit forms will properly relay feedback to the user. I want to have a button on a page that handles a request for me without going anywhere. The tap event does work but the user gets no feedback that something has happened.
The text was updated successfully, but these errors were encountered: