Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Make batch viewer tooltip persistent on mobile #116

Merged
merged 2 commits into from
Jun 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/apps/explorer/components/TransanctionBatchGraph/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,24 @@ function bindPopper(
target.on('position', () => popperUpdate)
target.cy().removeListener('pan zoom')
target.cy().on('pan zoom resize', () => popperUpdate)
target.cy().removeListener('tapstart')
target.removeListener('click tapstart mouseout')
const newTarget = document.getElementById(tooltipId)
const removePopper = (): void => {
if (newTarget) {
newTarget.remove()
}
popperRef.current?.destroy()
}
target
.on('click tapstart', () => {
.on('click tapstart', (evt: Event) => {
evt.stopPropagation()
if (newTarget) {
newTarget.classList.add('active')
}
})
.on('mouseout tapend', () => {
if (newTarget) {
newTarget.remove()
}
popperRef.current?.destroy()
})
.on('mouseout', removePopper)
target.cy().on('tapstart', removePopper)
}

interface GraphBatchTxParams {
Expand Down