accordproject / cicero-ui

A library of React components for Accord Project templates
Apache License 2.0
29 stars 46 forks source link

Pressing backspace with caret at start of variable allows delete of non variable text #374

Closed dselman closed 4 years ago

dselman commented 4 years ago

Pressing the backspace key with caret at start of variable allows delete of non variable text.

To Reproduce

  1. https://cicero-ui.netlify.com
  2. Place caret at the end of "Party A"
  3. Press backspace to delete all text in the variable except the "
  4. Press left arrow key
  5. Press backspace
  6. The line break outside the variable is removed

Expected behavior Should not be able to delete text outside of variables.

Desktop (please complete the following information):

irmerk commented 4 years ago

This looks solved, but a similar issue:

  1. https://cicero-ui.netlify.com
  2. Place cursor at end of "Party A"
  3. Press DELETE once
  4. Space between variable and next word is removed and cannot be re-added
jeromesimeon commented 4 years ago

This looks solved, but a similar issue:

  1. https://cicero-ui.netlify.com
  2. Place cursor at end of "Party A"
  3. Press DELETE once
  4. Space between variable and next word is removed and cannot be re-added

I'm not sure we are robust when we delete the " at the end (if this is what happens in this example). Could you add the Slate DOM before and after edit in that scenario?