Skip to content

Conversation

@shinvik
Copy link
Contributor

@shinvik shinvik commented Dec 9, 2019

No description provided.

src/usePopper.js Outdated
};

popperInstanceRef.current = new PopperJS(referenceElement, popperElement, {
...options,
Copy link
Member

Choose a reason for hiding this comment

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

should this use an options.popperConfig? otherwise we'd need to spread out the properties under options that we consume above.

probably doing an options.popperConfig makes the typing easier, too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

options.placement, options.modifiers, options.eventsEnabled is separate props, options.popperConfig is composite property of the remaining options of Popperjs. I think this could confuse users.

Copy link
Member

Choose a reason for hiding this comment

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

This is how e.g. <Overlay> works, though, no?

Copy link
Member

Choose a reason for hiding this comment

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

shoot, my bad, that's not how <Overlay> works. it does spread in the popper config like you had here. sorry about that.

but if i'm not mistaken, then, i think in usePopper, ...popperConfig should just be the options not explicitly consumed?

Copy link
Contributor Author

@shinvik shinvik Dec 10, 2019

Choose a reason for hiding this comment

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

how Overlay works

I didn't notice it.

Copy link
Member

Choose a reason for hiding this comment

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

no, sorry, i meant your initial implementation was correct. my suggestion above was bad. we should spread in ...popperOptions into usePopper. we just need to also spread out the options that we explicitly consume there. otherwise it would be a breaking change

Copy link
Member

@taion taion left a comment

Choose a reason for hiding this comment

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

@jquense can you take a look here? this looks good to me

@taion
Copy link
Member

taion commented Jan 6, 2020

@jquense ping

Copy link
Member

@jquense jquense left a comment

Choose a reason for hiding this comment

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

LGTM

@taion taion merged commit 48cd085 into react-bootstrap:master Mar 4, 2020
@taion
Copy link
Member

taion commented Mar 4, 2020

@Viktor-the-great sorry for the delay

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.

3 participants