WIP Upgrade basic-dropdown and power-select #736
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The usage of basic-dropdown and power-select is quite complex and seems hard to upgrade. These are the components that either fork, extend or use stuff from these dependencies:
Noted breaking upstream changes:
ember-basic-dropdown
The positioning logic now accounts for the position of the parent of container if it has position relative or absolute. The breaking part is that custom calculatePosition functions now take the destination element as third arguments, and the object with the options has now been moved to thr forth position.
Passing to="id-of-elmnt" to the {{#dropdown.content}} component is deprecated. The way to specify a different destination for ember-wormhole is now by passing destination=id-of-elmnt to the top-level {{#basic-dropdown}} component. The old method works but shows a deprecation message.
Unify calculatePosition and calculateInPlacePosition. Now the function receives an renderInPlace flag among its options, and based on that it uses a different logic. This reduces the public API surface. This new function is the default export of /utils/calculate-position. The individual functions used to reposition when rendered in the wormhole or in-place are available as named exports: calculateWormholedPosition and calculateInPlacePosition
It is a problem for a11y to have aria-owns/controls to an element that it's not in the DOM, so now there is a stable div with the right ID that gets moved to the root of the body when the component opens.
Don't display aria-pressed when the component is opened. The attribute is not present by default, but can be bound from the outside.
Don't display aria-haspopup by default, but display it if passed in a truthy value.
Use aria-owns instead of aria-controls to link trigger and content together.
Allow to customize the ID of the trigger component. Now the dropdown uses a new data-ebd-id attribute for query the trigger reliably. Unlikely to be breaking tho.
ember-power-select