Opened 10 years ago

Closed 7 years ago

Last modified 7 years ago

#5295 closed bug (fixed)

buttons doesn't remove hover state if they are disabled

Reported by: AzaToth Owned by:
Priority: major Milestone: 1.9.2
Component: ui.button Version: 1.8rc3
Keywords: haspatch Cc:
Blocked by: Blocking:

Description

if hovering over a mouse and at the same time disable it, they hover state will not be removed. following patch fixes the issue by forcing removal even if diabled is set.

Attachments (2)

jquery.ui.button.patch (643 bytes) - added by AzaToth 10 years ago.
jquery.ui.button-02.patch (1.5 KB) - added by AzaToth 10 years ago.
remade patch to remove states on "disabled" directly

Download all attachments as: .zip

Change History (24)

Changed 10 years ago by AzaToth

Attachment: jquery.ui.button.patch added

comment:1 Changed 10 years ago by Scott González

Milestone: 1.81.next

A better fix would be to remove the classes when the button becomes disabled.

comment:2 in reply to:  1 Changed 10 years ago by AzaToth

Replying to scott.gonzalez:

A better fix would be to remove the classes when the button becomes disabled.

Yea, that's an good idea, I've made an new patch to use that behavior.

Changed 10 years ago by AzaToth

Attachment: jquery.ui.button-02.patch added

remade patch to remove states on "disabled" directly

comment:4 Changed 9 years ago by Scott González

#6808 is a duplicate of this ticket.

comment:5 Changed 9 years ago by Scott González

Milestone: 1.next1.9

This should be fixed by using the new ._hoverable() method being added to the base widget.

comment:6 Changed 9 years ago by fofanafi

Here is a test case--after the button is disabled, the mouse is still in the hover state, although I'm not clear on whether this is an issue.

http://jsbin.com/adika3/4

comment:7 Changed 9 years ago by Scott González

Status: newopen

If button can use ._hoverable(), that would solve this problem.

comment:8 Changed 8 years ago by BikingGlobetrotter

I am using the second proposed patch, but it is not working as it should.

In the following example http://public.virtualmischa.de/bugs/jqueryui-button.html, you will see that after pressing "Play", "Stop" and "Play" the stop button is still in the hover state.

I tested it with Google Chrome. Firefox is even worse, because it is not removing hovering state for the play button with has not been disabled at all. Correction: Firefox stays in focus state not, not in hovering state. Sry for that

Last edited 8 years ago by BikingGlobetrotter (previous) (diff)

comment:10 in reply to:  9 Changed 8 years ago by Narretz

Replying to cgack:

commit to use _hoverable found here: https://github.com/cgack/jquery-ui/commit/bc7d98e3df3385b2b737171dc6207d0ac3cb57e4

Hi, can you please reupload the ptch for hoverable? The link to your github depository is dead. I have the same problem - actually it is also possible to make the disabled radio buttons "active" which shouldnt't happen.

comment:11 Changed 8 years ago by gigi81

I'm using 1.8.16 and encountered the same issue. Here is a jsFiddle that shows it: http://jsfiddle.net/gigi81/fav4R/3/

I don't understand why in 22 months the patch didn't make to the official stable release.

comment:12 Changed 8 years ago by Scott González

@gig81: In 22 months, nobody has provided a patch that does the right thing. The right thing is to use a general purpose solution across all widgets, which is what I've mentioned multiple times in this ticket.

comment:13 Changed 8 years ago by jdomnitz

what was the problem with the patch submitted by cgack?

comment:14 in reply to:  13 Changed 8 years ago by Scott González

Replying to jdomnitz:

what was the problem with the patch submitted by cgack?

Presumably the problem that Narretz said? cgack did submit a pull request 4 months later (after my comment), we just haven't gotten around to reviewing it yet.

comment:15 Changed 7 years ago by gtr053

A workaround I use for this is the following:

buttonObject.button('disable').blur().removeClass('ui-state-hover');

comment:16 Changed 7 years ago by Scott González

Milestone: 1.9.01.11.0

comment:17 Changed 7 years ago by mikesherov

Keywords: haspatch added

this ticket has a pull request: https://github.com/jquery/jquery-ui/pull/562

comment:18 Changed 7 years ago by Cory Gackenheimer

Resolution: fixed
Status: openclosed

Button: use _hoverable for hover state management. Fixes #5295 - button doesn't remove hover state if they are disabled

Changeset: 8e1ceba717b85e42a13cc1660e7c8e9e9c26c384

comment:19 Changed 7 years ago by Scott González

Milestone: 1.11.01.10.0

comment:20 Changed 7 years ago by Cory Gackenheimer

Button: use _hoverable for hover state management. Fixes #5295 - button doesn't remove hover state if they are disabled (cherry picked from commit 8e1ceba717b85e42a13cc1660e7c8e9e9c26c384)

Changeset: 85b5c5b5586af541291d52e5c52b9774e4ec2a22

comment:21 Changed 7 years ago by Scott González

Milestone: 1.10.01.9.2

comment:22 Changed 7 years ago by Scott González

#8829 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.