
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-async-input
Advanced tools
wrap React inputs so that asynchrous updates don't cause the cursor to jump
Wrap React inputs so that asynchrous updates don't cause the cursor to jump around.
Under very rapid keyboard input and/or network jitter conditions, this will still fail to do what you want. See these two fiddles for more:
http://jsfiddle.net/yrmmbjm1/1/
http://jsfiddle.net/yrmmbjm1/4/
I hope to work out a better way to handle all of this soon.
var DOM = require('react').DOM
var asyncInput = require('react-async-input')
var input = asyncInput(DOM.input)
// Or monkey-patch React.DOM, don't do this in a library!
// asyncInput.monkeyPatch(DOM)
react.createClass({
getInitialState: function () {
this.setState({name: 'Jerry! Sizzlah!'})
},
render: function () {
return DOM.div(null, [
DOM.label(null, 'Name:'),
input({
type: 'number',
value: this.state.name,
onChange: this.handleNameChange
})
])
},
// this asynchronous event handler no longer causes the cursor to jump around
handleNameChange: function (event) {
process.nextTick(function () {
this.setState({name: event.target.value})
}.bind(this))
}
})
I copied this technique from swannodette/om after dnolen told me about it. All credit to him for solving a problem I didn't know I was going to have before I even had it.
Licensed under the EPL (same as Om)
FAQs
wrap React inputs so that asynchrous updates don't cause the cursor to jump
The npm package react-async-input receives a total of 6 weekly downloads. As such, react-async-input popularity was classified as not popular.
We found that react-async-input demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.