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

Draft: feat(tooltip): create Tooltip #79

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

Conversation

alveshelio
Copy link

@alveshelio alveshelio commented Nov 7, 2022

This PR is dependent of #73 since it has changes to createFocusable

This is the port of Tooltip.

TODO

  • Tooltip
  • Tests
  • Update doc

This is my first contribution to the project. I am looking for feedback.

I have pretty much followed what @react-aria/tooltip is doing.

I'm having a Typescript error with the return of createTooltipTrigger.
I'm getting this error:

Types of property 'onFocus' are incompatible. 
Type 'EventHandlerUnion<any, 
FocusEvent> 
| EventHandlerUnion<HTMLElement, FocusEvent>
| undefined' is not assignable to type '((e: FocusEvent) => void) | undefined'.

Looking at the signature of onFocus from FocusEvents => onFocus?: (e: FocusEvent) => void; in @solid-aria/types, this is exactly the same signature as we have in @react-aria/types. In their implementation of onFocus, they are not passing the event to onFocus and it is not complaining in @react-aria

Looking at createFocusable interface FocusableResult, focusableProps: JSX.HTMLAttributes<any>; and onFocus in HTMLAttributes is indeed onFocus?: EventHandlerUnion<T, FocusEvent>;

@fabien-ml I see you worked in createFocusable, do you think you could help me out?

@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2022

⚠️ No Changeset found

Latest commit: 099f349

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@fabien-ml
Copy link
Member

EventHandlerUnion is the correct event type in Solid, I think the one from FocusEvents has to be the same, however i'm not sure how this will impact others packages

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.

2 participants