Re: [pointerevents] Click event while a pointer event is captured

>   Then I would just call that from the click handler of my clickable-row rather than trying to modify the checked attribute directly.

@NavidZ: Agreed that I could modify the click handler of the clickable row to call a method on the toggle button itself, instead of comparing the timestamps. But it is worth noting that being able to toggle the switch by simply setting/unsetting the `checked` attribute, is kind of important. It makes the custom `<cr-toggle>` element more consistent with a native `<input type="checkbox">`, and easier to drop-in replace. On the other hand, calling a non-standard method from the parent's click handler, makes the parent unnecessarily aware of the type of toggle it holds, which hinders the "drop-in replacement" ability.

Also, my point mainly is that the clickable row should not have received a 'click' event, when the toggle was the capturing element. And therefore just setting/unsetting the `checked` attribute should be sufficient, because it would only trigger when no capturing was involved. Any additional work seems unnecessary, whether it qualifies as a "hack" or not.


-- 
GitHub Notification of comment by freshp86
Please view or discuss this issue at https://github.com/w3c/pointerevents/issues/75#issuecomment-349732067 using your GitHub account

Received on Wednesday, 6 December 2017 18:31:08 UTC