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

Add function type for popperConfig option #32882

Merged
merged 4 commits into from
Feb 9, 2021

Conversation

rohit2sharma95
Copy link
Collaborator

Since shallow merge is used to merge popperConfig passed by the user for popper's config, this overrides the modifiers property instead of merging the array.

So creating popperConfig a function and then passing the default configuration as an argument gives users the ability to use the default configuration and merge it with their configuration. Keeping the previous type object in the supported types since removing it would be a breaking change.

Ref: #32443 (comment)

@XhmikosR Let me know if it is a good idea 🙂

@rohit2sharma95 rohit2sharma95 requested a review from a team as a code owner January 23, 2021 14:13
@XhmikosR
Copy link
Member

@rohit2sharma95 can you please add a test?

<td><code>null</code></td>
<td>To change Bootstrap's default Popper config, see <a href="https://popper.js.org/docs/v2/constructors/#options">Popper's configuration</a></td>
<td>To change Bootstrap's default Popper config, see <a href="https://popper.js.org/docs/v2/constructors/#options">Popper's configuration</a>. If you pass the <code>popperConfig</code> as a function, it accepts the Bootstrap's default Popper config as an argument, you need to return the configuration from this function as an object.</td>
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this is self-explanatory. Can we maybe reword this and all the instances in this PR? Perhaps with an example?

Copy link
Member

Choose a reason for hiding this comment

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

Agreed on wording here, needs a rev. After that should be good to go from my perspective.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated 👍

@XhmikosR XhmikosR force-pushed the rohit/main/popper-config-function branch from 0af13f6 to 41cf258 Compare February 9, 2021 12:35
@rohit2sharma95 rohit2sharma95 force-pushed the rohit/main/popper-config-function branch from 18d23c9 to 177c880 Compare February 9, 2021 18:20
@XhmikosR XhmikosR requested a review from mdo February 9, 2021 18:50
@XhmikosR
Copy link
Member

XhmikosR commented Feb 9, 2021

@mdo please check the wording and maybe if the example is easy to grasp. It might need some further tweaking :)

Copy link
Member

@mdo mdo left a comment

Choose a reason for hiding this comment

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

Pushed another rev of copy changes here, should be good to go from my perspective.

@XhmikosR XhmikosR merged commit f7088e5 into main Feb 9, 2021
@XhmikosR XhmikosR deleted the rohit/main/popper-config-function branch February 9, 2021 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants