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

Copying/pasting inside list elements doesn't work #249

Closed
fbarl opened this issue Dec 2, 2015 · 1 comment · Fixed by #267
Closed

Copying/pasting inside list elements doesn't work #249

fbarl opened this issue Dec 2, 2015 · 1 comment · Fixed by #267
Assignees
Labels

Comments

@fbarl
Copy link

fbarl commented Dec 2, 2015

I first noticed it in my app where I'm using Mobiledoc-kit, but it's easy to reproduce it on http://bustlelabs.github.io/mobiledoc-kit/demo/ as well.

Say I have a paragraph 'X' and a list with a single element 'Y'. I select 'X', copy it, then I select 'Y' and paste over it. That throws an error Uncaught TypeError: Cannot read property 'renderNode' of undefined for me on Chrome. Even when the cursor is collapsed, pasting inside <li> elements doesn't seem to work and neither does copying, which throws a different error for me: Uncaught Error: Cannot set section tagName to li.

I also tried Firefox, and similar thing happens, so the problem seems to be general. I was surprised that nobody has reported it since it seems this problem's been there for a while. :) Do you think there's an easy fix for it or it would require some deeper refactoring?

Thanks!

@mixonic
Copy link
Contributor

mixonic commented Dec 2, 2015

I was surprised that nobody has reported it since it seems this problem's been there for a while.

Ha! The community of users is still pretty small :-) I'm not surprised if we have a bug. Thanks for taking the time to report this, Cory or I will take a look shortly.

@mixonic mixonic added the bug label Dec 2, 2015
@bantic bantic self-assigned this Dec 7, 2015
bantic added a commit that referenced this issue Dec 7, 2015
bantic added a commit that referenced this issue Dec 14, 2015
bantic added a commit that referenced this issue Dec 14, 2015
bantic added a commit that referenced this issue Dec 15, 2015
  * fix bug in post#cloneRange when range starts in list item
  * add assert.isPostSimilar, assert.isRenderTreeEqual, assert.isPositionEqual

Fix #249 #259
bantic added a commit that referenced this issue Dec 15, 2015
  * fix bug in post#cloneRange when range starts in list item
  * add assert.isPostSimilar, assert.isRenderTreeEqual, assert.isPositionEqual

Fix #249 #259
bantic added a commit that referenced this issue Dec 16, 2015
  * fix bug in post#cloneRange when range starts in list item
  * add assert.isPostSimilar, assert.isRenderTreeEqual, assert.isPositionEqual
  * fix ListSection#clone to use the same tagName for the clonee as the cloner
  * add PostEditor#insertMarkers method
  * add private/intimate methods for splitting list items and lists in postEditor

Fix #249 #259
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants