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(types): add missing reference and popper class properties #759

Merged
merged 4 commits into from Mar 13, 2019

Conversation

@@ -158,6 +158,8 @@ declare class Popper {
static Defaults: PopperOptions;

options: PopperOptions;
popper: HTMLElement;
reference: HTMLElement;

constructor(reference: Element | ReferenceObject, popper: Element, options?: PopperOptions);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reference: Element, not HTMLElement?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can also be "custom reference object", we should already have a type for that somewhere

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't have done this at the end of the work day...
It should be:

popper: Element;
reference: Element | ReferenceObject;

I'll try to test and commit before leaving today.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit conflicting also, because in the code you have HTMLElement types for popper and reference, and Element in type definitions.

https://github.com/FezVrasta/popper.js/blob/bd1faa9a27499433443bb4c42b3dea9ecf055777/packages/popper/src/index.js#L17-L18

I'm not sure which one should be the correct one.
See this stackoverflow answer for details.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSDoc types are most likely wrong... But I don't have much time to verify it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be an SVGElement too. So that's why it's the base Element interface

@medfreeman
Copy link
Author

It seems good now!

@FezVrasta
Copy link
Member

@medfreeman may you double check the Flow types are in sync please?

@medfreeman
Copy link
Author

sure, about this feature only or in general ?
i've already seen missing properties, modifiers, Defaults, etc..
I could edit them, but not so familiar with flow syntax anymore.

@medfreeman
Copy link
Author

I'll have to do it tomorrow morning anyway.

@FezVrasta
Copy link
Member

I was thinking just about this specific fix.

But if you find other issues feel free to send PRs :-)

@medfreeman
Copy link
Author

I won't hesitate!
Ok, all good now!
Thanks for your library and reactivity!

@FezVrasta FezVrasta merged commit 4a8cc14 into floating-ui:master Mar 13, 2019
@medfreeman medfreeman deleted the typedefs branch March 13, 2019 11:35
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.

None yet

3 participants