lwc icon indicating copy to clipboard operation
lwc copied to clipboard

backspace on LWC Input rich text column removes total table

Open rahul-boinepally opened this issue 2 years ago • 11 comments

Describe the bug Create a component and add lightning-input-rich-text. Copy and paste a table from excel sheet. Table appears ok I can edit the values in table correctly. As soon as I hit a backspace in a column, whole table is deleted instead of the text I want to delete in a column.

To Reproduce Steps to reproduce the behavior:

Create a new Lwc component. Add ightning-input-rich-text to the html. Create a table in excel sheet and copy-paste it in the input rich text component in ui. Enter text into rows and columns. Delete any text in any column by hitting backspace - you will see complete table being deleted instead of the text I want to delete. Expected behavior The text I want to delete should be deleted on the backspace instead of total table.

Screenshots NA

Desktop (please complete the following information):

OS: Windows Browser : Chrome Version : 103.0.5060.114 Additional context Add any other context about the problem here.

rahul-boinepally avatar Aug 11 '22 19:08 rahul-boinepally

hey @nolanlawson thanks for adding the tag. I am wondering if you have any insight or a workaround for this? We are using the lightning rich text to create a email composer and creating a table in there is very critical. A table with a breaking backspace is no where useful so I am pretty much stuck now. I know this is due to quillJs but I dont have control of it or I am not even able to remove event listener on quillJs on backspace event. Many thanks.

rahul-boinepally avatar Aug 15 '22 21:08 rahul-boinepally

@rahul-boinepally I can't, sorry, but I've forwarded it to the correct internal team. You can also go through Salesforce's support channel if it helps to prioritize this.

nolanlawson avatar Aug 15 '22 21:08 nolanlawson

@rahul-boinepally I'm having a look into this one now and will get back to you.

Templarian avatar Aug 16 '22 14:08 Templarian

@rahul-boinepally We're seeing the same in 240 and main. Creating a bug internally to track this.

Templarian avatar Aug 16 '22 14:08 Templarian

thanks @Templarian , appreciate it. Do you have an approximate timeline for the fix. Happy to raise a case if it helps.

rahul-boinepally avatar Aug 16 '22 17:08 rahul-boinepally

@rahul-boinepally If you can please raise a case that would help a lot. It will be routed to our 'CCE Core UI Platform' and then me. Link to this issue.

I have a fix I believe I'm testing right now.

Templarian avatar Aug 16 '22 18:08 Templarian

@rahul-boinepally Looks like editing tables is not supported in lightning-input-rich-text. Tables are readonly, but it is something we're looking to allow eventually.

You can't create or edit a table or a header in the rich text editor.

https://developer.salesforce.com/docs/component-library/bundle/lightning-input-rich-text/documentation

Templarian avatar Aug 16 '22 19:08 Templarian

@Templarian ah thats a shame but thanks so much for checking this. Do you think of any work around / hack ? I am building an email composer using the lightning-input-rich-text and also created a toolbar button to inject the table into html. If there is a way to prevent default on the quillJs backspace event, it will be helpful.

rahul-boinepally avatar Aug 16 '22 21:08 rahul-boinepally

also tbh tables are not read-only in the rich text component :) I am able to do pretty much everything on the table except the backspace (delete works good too)

rahul-boinepally avatar Aug 16 '22 21:08 rahul-boinepally

@rahul-boinepally I reworded our work item internally to look into fixing this. I'll try and get this addressed in our upcoming release, but it's already busy.

Templarian avatar Aug 17 '22 12:08 Templarian

hey @Templarian - sorry to bother but I came across another issue where I am not able to resize the image in lightning-input-rich-text. Documentation says image cannot be resized on lightning-input-rich-text but wondering if resize is in roadmap at all? Do you think it is feasible for me to write a custom logic to implement resize as it was with CkeEditor. Many thanks.

rahul-boinepally avatar Aug 23 '22 21:08 rahul-boinepally

Hi @rahul-boinepally and @Templarian. Just a note that we had actually found out about this long ago as well, we didn't even know about this path to report LWC bugs! Hope this takes us somewhere :)

We have two issues:

  1. The main one is exactly as reported, and would like to emphasize the same as in some of the comments from @rahul-boinepally: only the backspace has this effect of removing the whole table, and editing text within the table works just fine.
  2. Delete, however, doesn't work perfectly either -> it does not delete the table, BUT sends the cursor outside of the table.

We would be really grateful is both could be fixed. I am going to log a Support Case right now to see if that can expedite anything.

Cheers!

juanjoseblancob avatar Aug 16 '23 22:08 juanjoseblancob

Support just sent me back to this: https://ideas.salesforce.com/s/idea/a0B8W00000K41WzUAJ/fix-lightninginputrichtext-edit-table-problem :(

So, really, we're at the mercy of the Salesforce developers reading this and "doing the right thing", outside of the company's bureaucracy!? 👍

juanjoseblancob avatar Aug 16 '23 23:08 juanjoseblancob