-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept non-text nodes in insertTextByKey #784
Conversation
Update fork
* origin/master:
Merge upstream master
* ianstormtaylor/master: Clarifying insertTextByKey description (ianstormtaylor#778) Documenting node's 'getFirstText' & 'getLastText' (ianstormtaylor#779) 0.19.22 fix selection handling for changing tabs, and inside embedded inputs, closes ianstormtaylor#749 fix to restrict window blur/focus handling, closes ianstormtaylor#773 remove warn throwing since console.warn includes callsites now Update defining-custom-block-nodes.md (ianstormtaylor#776) 0.19.21 update table example to make scope clearer Fixed the link to comparisons, which was broken (ianstormtaylor#769) fix error when dragging void nodes without selection, closes ianstormtaylor#757 fix to depend on prop-types for react 15.5 fix to maintain focus on switching tabs, closes ianstormtaylor#756 update issue template Add "data-key" to root div for the whole document (ianstormtaylor#759) add an issue template
Yay! Great work @oyeanuj. Can you add a test case that covers it and then I'm super down to merge? |
…-in-node * ianstormtaylor/master: Address doc suggestion in ianstormtaylor#644 (ianstormtaylor#760)
@ianstormtaylor Thanks! Added a test, let me know if it looks good? |
Hey @oyeanuj looks like a good start. I think we need to edit the test though to handle the more complex case. Right now, since the text node being inserted into is the first and only node, the Let me know how that goes! |
@ianstormtaylor I added a set up for a test case like you suggested. Can you take a look to make sure it ( |
@oyeanuj Looks good! I think we should also change the tests to not use |
Hey Ian, so I added the test case that we discussed and it didn't fail. So clearly I misunderstood your comment above - can you take a look and tell me what were you expecting instead? |
Hey @oyeanuj I'm not sure what I was talking about. I'm sorry for the slowness on this. Since this has been opened, it seems like we've had other issues where using offsets isn't the most robust, so I think I'd like to wait to merge this until we get those figured out. Right now we'd been trying to remove all offset-use-across-depths from the codebase I believe, so I'd rather not reintroduce one yet. |
@ianstormtaylor That makes sense, happy to wait! |
As of #3093 (which was just merged), I believe this issue is no longer applicable, because a lot has changed. I'm going through and closing out any potential issues that are not out of date with the overhaul. Thanks for understanding. |
Hi @ianstormtaylor, as per your comments in #775, this function now accepts a non-text node and calculates the leaf text node at the offset, and then proceeds to insert text.