Skip to content

Commit

Permalink
fix: trigger mouse leave action for atom when expanding
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed Sep 13, 2024
1 parent e8f3667 commit 32484de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ export function DraggableStructure(props: DraggableStructureProps) {
labelFontSize={15}
labelColor="rgb(0,0,0)"
molfile={molecule.molfile}
setSelectedAtom={handleOnClickAtom}
setSelectedAtom={(atom, event) => {
handleOnAtomHover();
handleOnClickAtom(atom, event);
}}
atomHighlightColor={
currentDiaIDsToHighlight?.length > 0
? '#ff000080'
Expand Down
2 changes: 1 addition & 1 deletion src/component/panels/MoleculesPanel/useAtomAssignment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export default function useAtomAssignment({
);

const handleOnAtomHover = useCallback(
(diaIDAndInfo: DiaIDAndInfo | undefined) => {
(diaIDAndInfo?: DiaIDAndInfo) => {
const { oclIDs } = extractFromAtom(diaIDAndInfo, nucleus);

// on enter the atom
Expand Down

0 comments on commit 32484de

Please sign in to comment.