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

error when typing after inserting card via button #286

Closed
bantic opened this issue Jan 7, 2016 · 0 comments
Closed

error when typing after inserting card via button #286

bantic opened this issue Jan 7, 2016 · 0 comments
Assignees
Milestone

Comments

@bantic
Copy link
Collaborator

bantic commented Jan 7, 2016

Similar to #285.
After inserting a card via a button click, the button is the activeElement and the window's selection is focused on the div of the section where the cursor had been, rather than focused inside its text node.
As a result, typing a key causes an error "could not find parent section for un-mapped text node".

To reproduce in the demo:

  • put cursor into a blank section
  • click "add image"
  • type a key

bug

@bantic bantic added this to the 0.8 milestone Jan 11, 2016
@bantic bantic self-assigned this Jan 11, 2016
bantic added a commit to bustle/ember-mobiledoc-editor that referenced this issue Jan 11, 2016
Fixes bustle/mobiledoc-kit#286
If the range is not set explicitly, the browser page can end up in a
state where:
  * the document.activeElement is outside the editor element
    (it's the button that the user clicked on to add the card)
  * the window.getSelection() is still inside the editor element
  * on the next keystroke, the browser will insert text into the
    contenteditable editor element at the selection, but only the
    mutation observer listeners will fire. This can result in an
    un-mapped text node being added to the mobiledoc editor, which
    causes errors to be thrown
bantic added a commit to bustle/ember-mobiledoc-editor that referenced this issue Jan 11, 2016
Fixes bustle/mobiledoc-kit#286
If the range is not set explicitly, the browser page can end up in a
state where:
  * the document.activeElement is outside the editor element
    (it's the button that the user clicked on to add the card)
  * the window.getSelection() is still inside the editor element
  * on the next keystroke, the browser will insert text into the
    contenteditable editor element at the selection, but only the
    mutation observer listeners will fire. This can result in an
    un-mapped text node being added to the mobiledoc editor, which
    causes errors to be thrown
bantic added a commit to bustle/ember-mobiledoc-editor that referenced this issue Jan 11, 2016
Fixes bustle/mobiledoc-kit#286
If the range is not set explicitly, the browser page can end up in a
state where:
  * the document.activeElement is outside the editor element
    (it's the button that the user clicked on to add the card)
  * the window.getSelection() is still inside the editor element
  * on the next keystroke, the browser will insert text into the
    contenteditable editor element at the selection, but only the
    mutation observer listeners will fire. This can result in an
    un-mapped text node being added to the mobiledoc editor, which
    causes errors to be thrown
bantic added a commit to bustle/ember-mobiledoc-editor that referenced this issue Jan 11, 2016
Fixes bustle/mobiledoc-kit#286
If the range is not set explicitly, the browser page can end up in a
state where:
  * the document.activeElement is outside the editor element
    (it's the button that the user clicked on to add the card)
  * the window.getSelection() is still inside the editor element
  * on the next keystroke, the browser will insert text into the
    contenteditable editor element at the selection, but only the
    mutation observer listeners will fire. This can result in an
    un-mapped text node being added to the mobiledoc editor, which
    causes errors to be thrown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant