material icon indicating copy to clipboard operation
material copied to clipboard

mdSwitch click and drag

Open GavinPalmer1984 opened this issue 11 years ago • 10 comments

Clicking the switch or text works great! But if you attempt to click and slide the switch you can experience some problems. I hate to admit that this is what I tried to do with the mouse when using the switch for the first time.

Low priority in my opinion.

GavinPalmer1984 avatar Apr 15 '15 17:04 GavinPalmer1984

+1

Actually, most of the users who were facing this attempted to "slide" the switch to the "on" position. I think it is something you can expect on the desktop. Unfortunately, sliding it from OFF to ON doesn't work, the switch returns back to OFF position and it is frustrating for the users.

VilemP avatar Apr 17 '15 08:04 VilemP

I am also getting issues with md-switch on a desktop (whether on ON or OFF position). For me the drag and drop is working perfectly fine, however the click event is being triggered after a dragend:

  • If dragged not over halfway -> model changes
  • if dragged over halfway -> model changes twice

The click event listener comes from MdCheckbox directive (its link function is invoked by MdSwitch).

troch avatar Apr 17 '15 13:04 troch

+1

uriva avatar Apr 27 '15 11:04 uriva

The cursor is also inconsistent - it's "move" over the switch itself, "pointer" in the surroundings, incl. any label. A "move" cursor does suggest a slide action should work.

fergusg avatar Jul 04 '15 13:07 fergusg

+1

meeDamian avatar Sep 05 '15 14:09 meeDamian

md-switch-drag-issue

Looks like drag isn't working properly when mouseup event is triggered over md-switch element..

oskarwrobel avatar Sep 18 '15 20:09 oskarwrobel

+1

paullang avatar Oct 21 '15 21:10 paullang

Did some looking into this and found the issue to be with the mdcheckbox click function like @troch did. Basically the click feature triggers a flip of the model value. Material copes with this by having mdswitch dragend event only flip the value if it shouldn't be flipped. Effectively canceling the flip made by mdcheckbox when the cursor is not moved enough and allowing mdcheckbox to flip it when it has. Going to tinker with both of them and see if I can get it to work without any magic numbers or such.

mattbrandman avatar Nov 05 '15 21:11 mattbrandman

This drag experience should be clearly better in #6715.

devversion avatar Jan 22 '16 20:01 devversion

This issue is closed as part of our ‘Surge Focus on Material 2' efforts. For details, see our forum posting @ http://bit.ly/1UhZyWs.

ThomasBurleson avatar Jun 02 '16 14:06 ThomasBurleson