Skip to content

Commit

Permalink
#2717 Tooltip for S-Group appears in upper left area of canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinEpam23 committed May 31, 2023
1 parent cc40113 commit 78d156c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 8 additions & 1 deletion packages/ketcher-core/src/domain/entities/sgroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,14 @@ export class SGroup {
if (!sGroup) {
return false
}
return sGroup.type === 'SUP'
return sGroup.type === SGroup.TYPES.SUP
}

static isDataSGroup(sGroup) {
if (!sGroup) {
return false
}
return sGroup.type === SGroup.TYPES.DAT
}

static isExpandedSGroup(sGroup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const InfoPanel: FC<InfoPanelProps> = (props) => {
const groupName = sGroup?.data?.name

useEffect(() => {
if (!groupStruct && sGroup?.type === 'DAT') {
if (SGroup.isDataSGroup(sGroup)) {
setSGroupData(`${sGroup.data?.fieldName}=${sGroup.data?.fieldValue}`)
} else {
setSGroupData(null)
Expand All @@ -119,7 +119,9 @@ const InfoPanel: FC<InfoPanelProps> = (props) => {
const width = size.x
const height = size.y

return molecule ? (
const showMolecule = molecule && !SGroup.isDataSGroup(sGroup)

return showMolecule ? (
<div
style={{
left: x + 'px',
Expand Down

0 comments on commit 78d156c

Please sign in to comment.