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

feat(annotation): Add the ability to override pointerEvents on Annotations #1879

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TSIA-SN
Copy link

@TSIA-SN TSIA-SN commented Sep 24, 2024

🚀 Enhancements

As discussed in #1433, it may be desirable to have pointer events enabled on Annotations. This PR exposes the pointerEvents attribute of the underlying elements while leaving the default as "none" to maintain the current behavior.

Note: I was not able to get the demo project to run locally, so this PR could probably use some testing code. However, I was able to take the built package and use it successfully in my personal project on an HTMLLabel as a smoke test.

Regarding SVGProps vs SVGAttributes (see packages/visx-annotation/src/components/Connector.tsx), I decided to use SVGAttributes since the pointerEvent attribute is set on a standard element as opposed to a custom element. Additionally, tracing the types through, SVGProps extends SVGAttributes, which is where pointerEvents is defined, so it seemed like the better option.

📝 Documentation

I'm guessing the docs are in a separate repo, but https://airbnb.io/visx/docs/annotation could be updated to reference the new props. I added JSLint comments to the new props so they will be visible to developers.

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

Successfully merging this pull request may close these issues.

1 participant