G. Scott Olson
G. Scott Olson
> We could also expose leftArrow and rightArrow as first-class keydown handler citizens, too. I think custom key bindings and handleKeyCommand will get me to a workable solution. But exposing...
> Your key binding function should fall through to return getDefaultKeyBinding(event);. :) It does. :wink: That is all the pseudocode at the top. I `return getDefaultKeyBinding(event)` for each non-relevant condition...
Yes. I think my hangup is that I have to duplicate much of the `EditorState`/`ContentState`/`SelectionState` introspection in both methods. However, my issue has been solved and that is the important...
> Are there any top-level API methods that you think might help streamline this? Hmm. Good question. Off the top of my head: - **`EditorState`** - `::getBlockAtSelectionStart()` - `::getBlockAtSelectionEnd()` -...
Yes, these would probably be better suited as a set of utility functions, similar to `RichUtils`. Thanks for following up.
@glenn-allen Can you provide a Gist with more code or a (non-working) example using jsFiddle or equivalent?
> I can handle this using a custom key binding… Within the custom key binding, `event.key === 'Tab'`is false but `event.key === 'Shift'` is true for Tab + Shift. **Can...
> Where do you see that? You’re right, I don’t. After trying a [`contentEditable` example](http://html5demos.com/contenteditable) elsewhere, I believe that the browser is handling Tab natively.
I made too many assumptions. :disappointed: Tab blurs the `contentEditable` in [this jsfiddle](https://jsfiddle.net/gscottolson/r6k3x7pw/).
Let me investigate further and see if I can isolate what appears to a bug specific to my Draft implementation.