Skip to content

Commit

Permalink
[bug] Fix cursor-jumping in text inputs
Browse files Browse the repository at this point in the history
Working around facebook/react#955 by forcing a
synchronous rerender on each keystroke, instead of letting
PersistentCharacterStore defer the publication of its state change.
  • Loading branch information
bartkusa committed Mar 5, 2016
1 parent 3283784 commit 959e8e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions js/ex3/actions/CharActions.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
var reflux = require('reflux');

module.exports = reflux.createActions([
const CharActions = module.exports = reflux.createActions([
"add",
"remove", // TODO: Change to delete?
"update",
"save",
"load",

"setName",
"setPortrait",
]);

['setName', 'setPortrait'].forEach((a) => {
CharActions[a] = reflux.createAction({sync: true});
});
2 changes: 1 addition & 1 deletion js/ex3/components/PersistentCharacterEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default React.createClass({
name: evt.target.value,
});

this.forceUpdate();
// this.forceUpdate();
},

_portraitImageOnDrop: function(evt) {
Expand Down

0 comments on commit 959e8e6

Please sign in to comment.