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

The 'importSelection' api did not consider the contentEditable=false elements #1417

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lzf0402
Copy link

@lzf0402 lzf0402 commented Jan 28, 2018

if before cursor is a contentEditable=false element, set the range to nextSibling

Q A
Bug fix? yes
New feature? no
BC breaks? yes/no
Deprecations? yes/no
New tests added? not needed
Fixed tickets comma-separated list of tickets fixed by the PR, if any
License MIT

Description

[Description of the bug or feature]

I use pasteHtml api to insert elements whose contentEditable attribute is 'false'; just like this:

<div contenteditable="false" id="imgcell">
   <img src="xx">
   <span>del img</span>
</div>
<p>test</p>

When the cursor at the start of the 'p' tag, then call 'saveSelection' and blur the editor and then call 'restoreSelection' and 'pasteHtml' to insert other content, it will be fail;

The importSelection api did not consider the contenteditable=false elements

--

Please, don't submit /dist files with your PR!

@lzf0402 lzf0402 changed the title misc: if before cursor is a contentEditable=false element, set the ra… The 'importSelection' api did not consider the contentEditable=false elements Jan 28, 2018
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) to 94.396% when pulling 507db5b on lzf0402:hotfix_fixselection_180128 into eef3ee0 on yabwe:master.

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

Successfully merging this pull request may close these issues.

2 participants