-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Popper.js v1 API migration instructions #62
Comments
FezVrasta
added a commit
that referenced
this issue
Aug 6, 2016
Merged
FezVrasta
changed the title
Improve modifiers API
Popper.js v1 API migration instruction
Aug 9, 2016
FezVrasta
changed the title
Popper.js v1 API migration instruction
Popper.js v1 API migration instructions
Aug 9, 2016
FezVrasta
added
FAQ
This question comes up a lot.
and removed
feature
This would be nice to have.
labels
Aug 9, 2016
7 tasks
I have a doubt ? regarding Tooltip.js. Options.Trigger takes only one item but in my case I need hover and focus both. how can I achieve that. |
you can put multiple values space separated |
Thank you. It works. |
how to get js ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Popper.js v1 introduces several breaking changes in its API, these changes are needed to make the API easier to use and the library more powerful and versatile.
Migration instructions
Modifiers definition
To add a custom modifier, define inside the
modifiers
option object, an object containing the propertiesorder
,enabled
andfunction
.each object must be assigned to a property with the name of the modifier, this name will be used internally to identify and refer this modifier
order
: order of execution of the modifier, the default modifiers configuration is defined here:https://github.com/FezVrasta/popper.js/blob/master/src/popper/modifiers/index.js#L30-L95
enabled
:true
to enable it,false
to disable itfunction
: the function that describes your custom modifier (the modifiers API is unaltered)onLoad
: function executed when Popper.js instance is created, useful to execute custom code at startup time.Configurations
The configurations related to a modifier have been moved inside their modifiers configurations.
options.preventOverflowOrder
is nowoptions.modifiers.preventOverflow.priority
options.arrowElement
is nowoptions.modifiers.arrow.element
options.offset
is nowoptions.modifiers.offset.offset
options.flipBehavior
is nowoptions.modifiers.flip.behavior
options.boundariesElement
is nowoptions.modifiers.flip.boundariesElement
andoptions.modifiers.preventOverflow.boundariesElement
. In this way you can have two different behaviors for the two modifiers.options.gpuAcceleration
is nowoptions.modifiers.applyStyle.gpuAcceleration
Callbacks
The chained interface used in v0 was flawed, we replaced it with a single-command interface where everything is defined in the constructor options.
has been replaced with:
Auto popper creation
In v0 there was a feature that allowed you to pass an object as second parameter of Popper to let it automatically create the DOM element used as Popper. This feature has been removed because it was out of scope in the core.
We replaced it with a new side library called Tooltip.js (you can find info about it in the README and at popper.js.org).
If you still need to use the feature, please take a look to this gist where you'll find a custom modifier that reintroduces the exact same feature with the same API. It includes a CodePen example!
https://gist.github.com/FezVrasta/075d228ffb855688c75a69c6d1d6afce
The text was updated successfully, but these errors were encountered: