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

Cannot delete a Clause with backspace #71

Open
dselman opened this issue Apr 14, 2020 · 4 comments
Open

Cannot delete a Clause with backspace #71

dselman opened this issue Apr 14, 2020 · 4 comments

Comments

@dselman
Copy link
Contributor

dselman commented Apr 14, 2020

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
@98lenvi
Copy link

98lenvi commented Apr 16, 2020

@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

@jolanglinais jolanglinais transferred this issue from accordproject/cicero-ui May 13, 2020
@Michael-Grover
Copy link

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.

@Cronus1007
Copy link
Contributor

Cronus1007 commented Mar 15, 2021

@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.

@jolanglinais
Copy link
Member

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.

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

5 participants