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

add line hover prop #544

Open
adnjoo opened this issue Feb 2, 2024 · 0 comments
Open

add line hover prop #544

adnjoo opened this issue Feb 2, 2024 · 0 comments

Comments

@adnjoo
Copy link

adnjoo commented Feb 2, 2024

Is your feature request related to a problem? Please describe.
I'm trying to activate e.g. a modal somewhere else (outside of the syntax highlighter component) on hover over a code line

Describe the solution you'd like
maybe something like onHover prop that the dev can pass a callback function to, to activate when a user e.g. hovers over said line

Describe alternatives you've considered
I hardcoded my own syntax highlighter to have a hover handler attached

I tried doing some raw JavaScript inside an useEffect on component mount to get the DOM element and attach an event listener onmouseenter but for some reason it wasn't working.

Briefly looked into useRef hook but wasn't sure how to get that to work correctly..

I also tried importing a JavaScript .js file with the DOM manipulations into the React component but I wasn't sure how to access the React hooks useState etc. from that file.

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant