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 list disappears when the editor's parent container is a list #972

Closed
seonim-ryu opened this issue May 7, 2020 · 0 comments
Closed

Comments

@seonim-ryu
Copy link
Member

seonim-ryu commented May 7, 2020

Describe the bug

When the editor's parent container is a list, the list disappears from WYSIWYG.

To Reproduce

Steps to reproduce the behavior:

  1. Enter a list in WYSIWYG editor.
  2. Newline within the list or edit the list.
  3. Or change the mode with the Markdown editor.
  4. The entered list disappears.
<ul>
  <li style="padding:10px;border:1px solid blue;">
    <ul>
      <li style="padding:10px;border:1px solid red;">
        <div id="editor"></div>
      </li>
    </ul>
  </li>
</ul>

wrong

Expected behavior

The list should remain entered.

correct

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

When using .find() of jQuery in the editor and changing it to querySelectorAll(), the behavior changed. jQuery searches for children from the currently selected element, but querySelectorAll() refers to the entire node list. So, when using the descendant combinator, there is an issue that behaves differently as follows.

Note: https://developers.google.com/web/updates/2013/03/What-s-the-CSS-scope-pseudo-class-for#when_queryselector_goes_wrong

To solve this problem, the :scope pseudo-class can be used, but since IE is not supported, it is solved by logic.

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

No branches or pull requests

1 participant