Skip to content
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

Embedded inputs + textareas lose focus on input #749

Closed
conorcussell opened this issue Apr 24, 2017 · 4 comments
Closed

Embedded inputs + textareas lose focus on input #749

conorcussell opened this issue Apr 24, 2017 · 4 comments
Labels

Comments

@conorcussell
Copy link
Collaborator

conorcussell commented Apr 24, 2017

Since this commit, an embedded input, like the one seen in the embed example, loses focus when it is changed. Meaning you can only type 1 character at a time.

I'm not sure what is the best way of preventing this being called when the input is a child of the editor, or if that would cause any other bugs. Any ideas?

@ianstormtaylor
Copy link
Owner

Hey @conorcussell I think the codebase has changed such that I'm not sure what line you were referencing there any more.

But maybe that element.contains check needs to be altered to account for nested contenteditable="false" elements. Not totally sure on this one off the top of my head.

@conorcussell
Copy link
Collaborator Author

Updated my comment so it points to the correct method updateSelection now on line 160.

Yeah, I'll writing something which checks for nested elements and submit a PR if I get something that works. Thanks for the hint!

@ianstormtaylor
Copy link
Owner

Realized what was going on, and just releasing a fix for it now!

@conorcussell
Copy link
Collaborator Author

Awesome, thanks @ianstormtaylor

oyeanuj added a commit to oyeanuj/slate that referenced this issue May 4, 2017
* 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
oyeanuj added a commit to oyeanuj/slate that referenced this issue May 4, 2017
* 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
oyeanuj added a commit to oyeanuj/slate that referenced this issue May 4, 2017
* ianstormtaylor/master: (81 commits)
  Address doc suggestion in ianstormtaylor#644 (ianstormtaylor#760)
  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
  add note to document documentation (ianstormtaylor#755)
  Fix typo in plugin.md (ianstormtaylor#753)
  update readme
  ...
oyeanuj added a commit to oyeanuj/slate that referenced this issue May 4, 2017
…-firstonly

* ianstormtaylor/master:
  Address doc suggestion in ianstormtaylor#644 (ianstormtaylor#760)
  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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants