Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot select bonds when we add molecule with addFragment, setMolecule or "Paste from clipboard" #4154

Closed
luna215 opened this issue Feb 27, 2024 · 6 comments · Fixed by #4194
Assignees
Labels

Comments

@luna215
Copy link

luna215 commented Feb 27, 2024

Steps to Reproduce
First type of scenario:

  1. Init ketcher
  2. call ketcher.addFragment
  3. Try to select bond (only atoms are selectable

Second type of scenario:

  1. Init ketcher
  2. call ketcher.setMolecule
  3. Try to select bond (only atoms are selectable

Third type of scenario:

  1. Click "Open..."
  2. Select "Paste from clipboard"
  3. Put some molecule
  4. Click "Open as New Project"

Actual behavior
When we hover over a bond we cannot select it nor is the bond highlighted. When we click on the bond, it also does not select the bond
Screenshot 2024-02-26 at 5 43 15 PM

Expected behavior
When we hover over a bond, we should see a highlight of the bond and we should be able to select it:

Highlight when we hover over a bond:
Screenshot 2024-02-26 at 5 43 48 PM

Selected bond
Screenshot 2024-02-26 at 5 44 17 PM

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Mac OS w/ M2 chip
  • Chrome: 121.0.6167.184
  • React version: 18.2.0

Ketcher version [e.g. v2.4.2].
v2.19.0

@luna215 luna215 added the bug label Feb 27, 2024
@luna215
Copy link
Author

luna215 commented Feb 27, 2024

A hacky way I did to get around this was to do the following for anyone needing a quick fix to this:

ketcher.addFragment(updateLigandData.smiles);
   setTimeout(() => {
   ketcher.editor.selection("all");
   ketcher.editor.selection(null);
}, 1000);

@rrodionov91
Copy link
Collaborator

Hi @luna215 !

Thank you for raising the issue. We reproduced it and planned to fix.

@luna215
Copy link
Author

luna215 commented Feb 27, 2024

@rrodionov91 happy to help wherever I can with this.

@tmrr13 tmrr13 linked a pull request Mar 1, 2024 that will close this issue
9 tasks
@rrodionov91 rrodionov91 linked a pull request Mar 4, 2024 that will close this issue
9 tasks
@tmrr13 tmrr13 linked a pull request Mar 5, 2024 that will close this issue
9 tasks
@ilya-asiyuk-epam ilya-asiyuk-epam changed the title Cannot select bonds when we add molecule with adddFragment Cannot select bonds when we add molecule with addFragment Mar 5, 2024
@ilya-asiyuk-epam ilya-asiyuk-epam changed the title Cannot select bonds when we add molecule with addFragment Cannot select bonds when we add molecule with addFragment, setMolecule Mar 5, 2024
@ilya-asiyuk-epam ilya-asiyuk-epam changed the title Cannot select bonds when we add molecule with addFragment, setMolecule Cannot select bonds when we add molecule with addFragment, setMolecule or "Paste from clipboard" Mar 5, 2024
ilya-asiyuk-epam added a commit that referenced this issue Mar 5, 2024
ilya-asiyuk-epam added a commit that referenced this issue Mar 5, 2024
ilya-asiyuk-epam added a commit that referenced this issue Mar 6, 2024
ilya-asiyuk-epam added a commit that referenced this issue Mar 6, 2024
ilya-asiyuk-epam added a commit that referenced this issue Mar 6, 2024
ilya-asiyuk-epam added a commit that referenced this issue Mar 7, 2024
ilya-asiyuk-epam added a commit that referenced this issue Mar 7, 2024
ilya-asiyuk-epam added a commit that referenced this issue Mar 7, 2024
…dd-molecule-with-addFragment_3

#4154 -  Cannot select bonds when we add molecule with addFragment, setMolecule or Paste from clipboard
ilya-asiyuk-epam added a commit that referenced this issue Mar 7, 2024
…ragment, setMolecule or Paste from clipboard
ilya-asiyuk-epam added a commit that referenced this issue Mar 7, 2024
…ragment, setMolecule or Paste from clipboard
ilya-asiyuk-epam added a commit that referenced this issue Mar 7, 2024
…ragment, setMolecule or Paste from clipboard
ilya-asiyuk-epam added a commit that referenced this issue Mar 7, 2024
…ragment, setMolecule or Paste from clipboard
ilya-asiyuk-epam added a commit that referenced this issue Mar 7, 2024
…ragment, setMolecule or Paste from clipboard
ilya-asiyuk-epam added a commit that referenced this issue Mar 7, 2024
…ragment, setMolecule or Paste from clipboard
ilya-asiyuk-epam added a commit that referenced this issue Mar 7, 2024
…dd-molecule-with-addFragment

Backmerge: #4154 - Cannot select bonds when we add molecule with addFragment, setMolecule or Paste from clipboard
@Zhirnoff
Copy link
Collaborator

Tested. Fixed.
2024-03-11_17h25_13

@luna215
Copy link
Author

luna215 commented Mar 11, 2024

Greatly appreciate this quick fix! Ya'll 🪨 !

@Zhirnoff
Copy link
Collaborator

@luna215 You're welcome! Glad the Ketcher team could help! If you have any more questions or need further assistance, feel free to ask. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
5 participants