Skip to content

Commit

Permalink
fix(Checkbox): adds RAF to fix unresponsive iOS checkbox fixes #294
Browse files Browse the repository at this point in the history
  • Loading branch information
James Friedman committed Sep 4, 2018
1 parent af015a4 commit fb53f44
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Checkbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@ export class Checkbox extends withFoundation({
this.nativeCb_.removeEventListener('change', this.handleChange_);

this.handleChange_ = () => {
this.syncWithProps(this.props);
this.foundation_.handleChange();
// RAF fixes #294 for an unknown reason
// Checkbox not responsive on iOS.
window.requestAnimationFrame(() => {
this.syncWithProps(this.props);
this.foundation_.handleChange();
});
};

this.nativeCb_.addEventListener('change', this.handleChange_);
Expand Down

0 comments on commit fb53f44

Please sign in to comment.