epam / ketcher

Web-based molecule sketcher
https://lifescience.opensource.epam.com/ketcher/demo.html
Apache License 2.0
488 stars 166 forks source link

Macro: Inconsistent viewport position in the “Library” panel after clearing the “Search” menu #4314

Open ViktoriaTkacheva opened 7 months ago

ViktoriaTkacheva commented 7 months ago

Steps to Reproduce

  1. Launch “Ketcher” and switch to the Macro mode
  2. Enter any request (for example, na) in the "Search" menu
  3. Click on any monomer, but without scrolling (for example, Phe-al)
  4. Click on the "Clear" button in the "Search" menu
  5. Verify the initial position of monomers in the tab (the letter A is indicated to the left of the monomers)
  6. Enter any request (for example, na) in the "Search" menu
  7. Scroll down and click on any monomer (for example, OBz)
  8. Click on the "Clear" button in the "Search" menu
  9. Verify the initial position of monomers in the tab (the letters M, N, or X are indicated to the left of the monomers)
  10. Compare results 5 and 9 points

Actual behavior If the user scrolled the search results, then after clearing the "Search" menu, his viewport in the “Library” panel moves to a random position, not related to the previous search or selected elements. This behavior is observed in the “Peptides” and “RNA” tabs, but if you add a large number of monomers to the “Favorites” tab, then the behavior will be the same

Expected behavior If the user scrolled the search results, then after clearing the "Search" menu, his viewport in the “Library” panel moves to a predictable position (at the beginning of the list of monomers at the letter A or at the last selected monomer)

Screenshots

https://github.com/epam/ketcher/assets/139227567/41c92361-d57d-4b69-9085-81923d770ed1

https://github.com/epam/ketcher/assets/139227567/f421d988-51d7-472d-910b-06cb77d9378b

Desktop (please complete the following information):

Ketcher version 2.20.0-rc.1

Issue found while testing https://github.com/epam/ketcher/issues/3750

AlexeyGirin commented 7 months ago

Too minor. Moved to Refined Backlog