mcc@mcclure111·Feb 7, 2016Me: How do I move the text cursor in React Google: Let me tell you about the cursor pattern in stateless functional programming Me: *cries*4523
Andy Matuschak@andy_matuschak·Feb 7, 2016@mcclure111 I’d probably make a `selectionRange` prop on a TextArea component and call setSelectionRange in componentWillReceiveProps.11
Andy Matuschak@andy_matuschakReplying to @mcclure111@mcclure111 <textarea> emits a “selectionchange” event. Should be able to <textarea onSelectionChange=…>3:58 PM · Feb 7, 2016·Tweetbot for Mac1 Like
mcc@mcclure111·Feb 7, 2016Replying to @andy_matuschak@andy_matuschak (1) Does "selection" include the cursor when nothing is selected? (2) Will this work with contentEditable?1
Andy Matuschak@andy_matuschak·Feb 7, 2016@mcclure111 1. Yeah, it has a zero-length range. 2. I think so, yes—give it a shot.1