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

Popper v2 support #150

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Popper v2 support #150

wants to merge 3 commits into from

Conversation

pzubar
Copy link

@pzubar pzubar commented Jul 28, 2022

This PR addresses the following issue.

It updates the addon's code to support popper v2 instead of popper.js. The migration is made according to the official migration guide.

The migration is the breaking change made in order to support the latest Poper's API. The components' API is changed accordingly.

Some of the changes that are not covered in a migration guide:

  • Popper's scheduleUpdate() is now update() (and returns a promise). That means we can use it directly without wrapping the update with the "ember-raf-scheduler".

@tylerturdenpants
Copy link
Collaborator

Ok. Nice. I'll look this over and if all is good we can have a breaking change. Thanks for this work.

@pzubar pzubar mentioned this pull request Jul 28, 2022
*/
onUpdate: null,
Copy link
Author

Choose a reason for hiding this comment

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

@@ -42,11 +42,7 @@
border-color: #FFC107;
}

.popper[x-placement^="top"] {
margin-bottom: 5px;
Copy link
Author

Choose a reason for hiding this comment

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

The padding between the popper and its reference element is now managed with offset modifier https://popper.js.org/docs/v2/migration-guide/#4-remove-all-css-margins

}

this._popper = new Popper(popperTarget, this._popperElement, options);
this._popper = Popper.createPopper(popperTarget, this._popperElement, options);
Copy link
Author

Choose a reason for hiding this comment

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

I am a bit newbie here so I am interested why can't we import popper like import { createPopper } from '@popperjs/core'; and have to use the UMD way? 🤔

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.

2 participants