web-components icon indicating copy to clipboard operation
web-components copied to clipboard

Cannot delete a Clause with backspace

Open dselman opened this issue 4 years ago • 4 comments

We currently prevent removing Clauses using the backspace key. This means that you cannot easily remove all of the contract text if the contract contains a clause.

To Reproduce

  1. Go to https://cicero-ui.netlify.com
  2. Press CTRL-A to select all the text in the editor
  3. Press backspace
  4. Nothing happens (NOK)

Expected behavior I think if that is the selection range completely encompasses a clause then backspace should remove it.

Desktop (please complete the following information):

  • OS: Mac OS
  • Browser Safari
  • Version 13.1

dselman avatar Apr 14 '20 17:04 dselman

@dselman, it seems to work when lockText prop is set to false. Please refer to the gif below.

Peek 2020-04-16 19-59-working

98lenvi avatar Apr 16 '20 14:04 98lenvi

Can we give the user that extends this component the option to choose between allowing clauses to be deleted by backspace, and not allowing clauses to be deleted by backspace? In some apps that extend this component, such as Clause.io, clauses can have many settings that can take a long time to configure. By allowing one stroke of backspace to delete an entire Clause, it could make it too easy to accidentally delete.

Michael-Grover avatar Mar 12 '21 18:03 Michael-Grover

@Michael-Grover I agree with this part of yours.If the user accidentally does it then we can send a toast notification to the user and if the user clicks ok then it will be deleted.

Cronus1007 avatar Mar 15 '21 14:03 Cronus1007

I think there will be quite a few considerations to be taken when deleting a clause. For instance, how the information will likely be passed to the Library component, or any other component being used upstream which relies on the data of the contract.

I don't think AP wants to be using toast for anything at this point.

jolanglinais avatar Mar 15 '21 15:03 jolanglinais