miztroh-zz/wysiwyg-e

URL disappears in link popup when reopening the popup

Opened this issue · 1 comments

Hello,
I am using the link tool to define URL links. I discovered one pretty annoying bug though. Here is how to reproduce it:

  1. Select a word and click on the link button to open the link popup
  2. Fill in all fields and click on the check-mark button, so the popup closes, but the word stays selected
  3. Click on the link button again -> Now the URL previously filled in vanished

This does not happen, when I move my cursor to another word after step 2, then select the original word again and perform step 3

If I comment https://github.com/miztroh/wysiwyg-e/blob/f7dad165ba5c83520423654e210e004c20f2117d/tools/link.html#L195 and https://github.com/miztroh/wysiwyg-e/blob/f7dad165ba5c83520423654e210e004c20f2117d/tools/link.html#L196, this behavior is fixed. Do you remember, why the linkUrl and linkTarget are reset after closing the dropdown? If there wasn't a special purpose, can you please remove the two lines?

Thanks a lot for your help!
Best regards,
Marco

Issue is confirmed, but clearing the data when the dropdown closes is needed to make sure the old data is gone when you go to edit another link. When a link is in the selection, the data gets repopulated. However, for some reason the browser says a selection with its caret at the beginning of the link doesn't have the link in it but a selection with its caret at the end of the link does. I'm going to try to see if I can reposition the caret to the end of the link after creating it.