Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Bard MediumEditor: Complete Editor Content gets deleted, when placing Fieldset after unordered or ordered List #2178

Closed
n0rthk1n9 opened this issue Sep 20, 2018 · 3 comments

Comments

@n0rthk1n9
Copy link

Describe the bug
In Mozilla Firefox Quantum 62.0, when you add an ordered or unordered List to a Bard MediumEditor field and you press return two times after the last point of the list and then you add any different fieldset, the whole content of the editor gets deleted.

To Reproduce
Steps to reproduce the behavior:

  1. Open statamic in Firefox Quantum 62.0
  2. Scroll to a Bard MediumEditor Field
  3. Type any Text
  4. Select Text and click on ordered or unordered list
  5. Add as many items to the list as you like
  6. Press return two times to exit the list
  7. Doubleclick the cursor position to show the plus symbol to add a fieldset
  8. Add any fieldset to the Bard MediumEditor field without changing the position of your cursor
  9. Complete Bard MediumEditor content disappears and an empty copy of the fieldset which you chose ist the only element left in the editor

Expected behavior
The expected behavior in this process would be, that a new empty copy of the chosen fieldset is added after the ordered or unordered list and everything else in the Bard MediumEditor field is still there.

Screenshots
Screencast of the problem:
statamic_bard_mediumeditor_error_screencast.zip

Environment details:

  • Statamic Version 2.10.4
  • Upgrade from 2.9.8
  • OS: macOS High Sierra 10.13.6
  • Browser: Mozilla Firefox Quantum 62.0
  • Web Server: Apache 2.4.34 (Unix)
  • PHP Version: 7.1.17
  • Addons installed: several including self developed addons

Additional context
When you inspect the Bard MediumEditor after step 6., you see that Firefox wraps div tag around the inserted br tag resulting into this code:

<ol>
  <li>Point 1</li>
  <li>Point 2</li>
  <li>Point 3</li>
</ol>
<div>
  <p>
    <br>
  </p>
</div>

Under normal conditions where this behavior does not appear, as in Safari 12.0 (13606.2.11) on macOS High Sierra 10.13.6 or in Google Chrome 69.0.3497.100 on macOS High Sierra 10.13.6, the generated Code by the Bard MediumEditor looks as the following when you inspect it:

<ol>
  <li>Point 1</li>
  <li>Point 2</li>
  <li>Point 3</li>
</ol>
<p>
  <br>
</p>

The div Tag around the p tag is only visible in the inspector for like a millisecond and is removed right away.

@jackmcdade
Copy link
Member

jackmcdade commented Sep 20, 2018 via email

@n0rthk1n9
Copy link
Author

Yes thats correct. Safari, Chrome and Firefox ESR 52.9.0 work fine. Only Firefox Quantum 62.0 has this issue. I did not test IE11 and Edge, but I can do so if you want.

@efoken
Copy link

efoken commented Oct 16, 2018

Same issue with Firefox here. Contents get deleted when placing a Set via the plus-symbol after <h2>, <ul> or <ol>.

Tested with:
Firefox Quantum 62.0.3
Firefox Quantum 63.0b14
Firefox Quantum ESR 60.2.2

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

No branches or pull requests

4 participants