Skip to content

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

Open
TSIA-SN wants to merge 1 commit into
airbnb:masterfrom
TSIA-SN:enhancement-annotation-pointerEvents-override
Open

feat(annotation): Add the ability to override pointerEvents on Annotations#1879
TSIA-SN wants to merge 1 commit into
airbnb:masterfrom
TSIA-SN:enhancement-annotation-pointerEvents-override

Conversation

@TSIA-SN
Copy link
Copy Markdown

@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