SitePen / dgrid

A lightweight, mobile-ready, data-driven, modular grid widget designed for use with dstore
http://dgrid.io/
Other
628 stars 295 forks source link

Fix bug with selector checkboxes on touch devices #1480

Closed edhager closed 3 years ago

edhager commented 3 years ago

Fixes: #1476

On some touch devices, if the code responds to a click event on a checkbox (<input type="checkbox">) and tries to modify the checked attribute, it seems to toggle the checkbox:

  1. Click on checkbox.
  2. Click event handler sets checked to true.
  3. Checkbox ends up being unchecked.

If the same event handler responds to a change event, then it works fine. So this PR modifies the selector code to respond to change events on the checkboxes. This works fine in desktop browsers and fixes the issue with mobile/touch-based browsers.