microsoft / roosterjs

roosterjs is a framework-independent javascript rich text editor.
Other
1.19k stars 161 forks source link

Fix findEditingImage #2794

Closed juliaroldi closed 2 months ago

juliaroldi commented 2 months ago

When image does not have id and the imageId parameter does not exist the findEditingImage was return the image as editing image, what is not correct. To avoid that issue, only compare the imageId and the image id, if imageId parameter exists.

To repro the bug:

  1. Paste two images
  2. Click at the second one
  3. Press a key
  4. The first image will be replaced by the second.

Before:

imageIdBug

After:

imageIdBugFix