migaku-official / migaku-browser-extension-issue-tracker

An issue tracker for bugs and other issues related to the Migaku browser extension.
2 stars 0 forks source link

Clipboard: Double click to play audio stops working for pre-existing clippings if any other clippings are deleted #34

Open melink14 opened 2 years ago

melink14 commented 2 years ago

Describe the bug I'm using Migaku Clipboard with auto parse enabled. When a clipping is first detected and parsed, double clicking to play audio works well. However, if I use the 'x' icon to remove another clipping from the list then any remaining clippings no longer support playing audio via double-click. If I copy something new, then it will work fine until the next time a clipping is delted.

To Reproduce Steps to reproduce the behavior:

  1. Go to Migaku Clipbard
  2. Copy some Japanese text
  3. Notice that double clicking on Japanese words plays forvo audio.
  4. Press 'x' to remove a different clipping.
  5. Notice that double clicking on Japanese words in the previous clipping no longer plays audio.

Expected behavior Double click to play audio should work for existing parsed clippings even if other clippings are deleted.

Desktop (please complete the following information):

Additional context I checked the dev console but didn't see any errors. I also noticed when audio works double clicking does not highlight the text being clicked on; however, after the bug is triggered double clicking on the Japanese text does cause the text to be highlighted normally. This makes me think the click handler which would usually play forvo audio is being removed when the list re-renders after deleting an item (since the same handlers probably prevent highlighting).

melink14 commented 2 years ago

Just realized with further testing that this bug only happens if you delete a clipping above the clipping you're testing. In other words, deleting a clipping, disables double click audio in all clippings that were below it. Clippings that were above the deleted clipping will still work!