Device-Bugs icon indicating copy to clipboard operation
Device-Bugs copied to clipboard

checkbox.attr('checked') doesnt trigger repaint on jelly bean android browser on galaxy nexus

Open max-mapper opened this issue 13 years ago • 0 comments

If you use $('.someCheckboxInput').attr('checked') to change the checked status of a checkbox it wont repaint css rules matching input[type="checkbox"]:checked

a workaround is to call a function like this after you change the checkbox on elements that should get updated:

function redraw(obj) {
  obj.hide()
  obj.each(function() { this.offsetHeight })
  obj.show()
}

simply accessing the offsetHeight property forces a redraw

max-mapper avatar Jul 18 '12 19:07 max-mapper