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

Fix highlight button causing issues clicking underlying track features #4594

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@ import { IExtendedLGV } from '../../model'
type LGV = IExtendedLGV

const useStyles = makeStyles()({
bookmarkButton: {
overflow: 'hidden',
position: 'absolute',
zIndex: 1000,
},
highlight: {
// when the highlight is small, overflow:hidden makes the icon/indicators
// invisible
overflow: 'hidden',
height: '100%',
position: 'absolute',
zIndex: 100,
pointerEvents: 'none',
},
highlightButton: {
// re-enable pointerEvents on the button
pointerEvents: 'auto',
},
})

Expand Down Expand Up @@ -69,18 +66,19 @@ const Highlight = observer(function Highlight({ model }: { model: LGV }) {
})
.filter(notEmpty)
.map(({ left, width, highlight, label, bookmark }, idx) => (
<div
/* biome-ignore lint/suspicious/noArrayIndexKey: */
key={`${left}_${width}_${idx}`}
className={classes.highlight}
style={{
left,
width,
background: highlight,
}}
>
{showBookmarkLabels ? (
<div className={classes.highlightButton}>
/* biome-ignore lint/suspicious/noArrayIndexKey: */
<React.Fragment key={`${left}_${width}_${idx}`}>
<div
className={classes.highlight}
id="highlight"
style={{
left,
width,
background: highlight,
}}
/>
{showBookmarkLabels && width > 20 ? (
<div className={classes.bookmarkButton} style={{ left }}>
<CascadingMenuButton
menuItems={[
{
Expand Down Expand Up @@ -111,7 +109,7 @@ const Highlight = observer(function Highlight({ model }: { model: LGV }) {
</CascadingMenuButton>
</div>
) : null}
</div>
</React.Fragment>
))
: null
})
Expand Down
Loading