svgedit icon indicating copy to clipboard operation
svgedit copied to clipboard

Sometimes shape can't be deleted by pressing Del key

Open lisupeng opened this issue 2 years ago • 8 comments

I used svgedit in tsailun project: https://github.com/lisupeng/tsailun

Sometimes shape can't be deleted by pressing Del key

lisupeng avatar May 16 '22 01:05 lisupeng

Hello, thank you for the report but please provide a way to reproduce the issue .

jfhenon avatar May 16 '22 07:05 jfhenon

Thanks help look into this issue. I captured a video: https://youtu.be/kMwuESpa7nI Reproduce steps:

  1. Create a shape
  2. Open the svg again and select the shape.
  3. The shape can't be deleted by pressing key

lisupeng avatar May 18 '22 08:05 lisupeng

I can't reproduce using V7. Please reproducing using https://svgedit.netlify.app/editor/index.html

jfhenon avatar May 29 '22 09:05 jfhenon

Thanks for your help!

This happens when I use svgedit in iframe and focus isn't on iframe by default. Clicking a svg shape doesn't change focus either.

This issue can be fixed by calling window.focus() in svgedit init().

lisupeng avatar Jun 17 '22 07:06 lisupeng

Focus will be changed to svgedit after clicking svgedit's toobar. So sometime it works.

lisupeng avatar Jun 17 '22 07:06 lisupeng

Thanks for your help!

This happens when I use svgedit in iframe and focus isn't on iframe by default. Clicking a svg shape doesn't change focus either.

This issue can be fixed by calling window.focus() in svgedit init().

Could you provide a PR to fix the issue?

jfhenon avatar Jun 18 '22 08:06 jfhenon

Since there's only one line code change, can anyone help piggyback the code ?

lisupeng avatar Jul 11 '22 13:07 lisupeng

I would be please to help but can you detail exactly what needs to be modified. Thanks

jfhenon avatar Jul 12 '22 14:07 jfhenon