-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Conversation
@rohit2sharma95 can you please add a test? |
8f2b842
to
95b9bf6
Compare
094dd50
to
0af13f6
Compare
<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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated 👍
0af13f6
to
41cf258
Compare
18d23c9
to
177c880
Compare
@mdo please check the wording and maybe if the example is easy to grasp. It might need some further tweaking :) |
There was a problem hiding this 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.
Since shallow merge is used to merge
popperConfig
passed by the user for popper's config, this overrides themodifiers
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 typeobject
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 🙂