-
Notifications
You must be signed in to change notification settings - Fork 379
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
Unable to render a trigger component instead of the default one in new release of ember-power-select. #1429
Comments
Can you provide a simple reproduction. I believe that this scenario is covered by the tests, seems weird that we had a regression on that. Perhaps you have conflicting versions of ember-basic-dropdown? |
I might have the same issue, I shared some details here. |
Thanks @cibernox for your response. Here is the simple reproduction of our use case:
And here is an example of our components/templates for select/multiselection fields:
Reaching out ember-power-multiselect in the other components is like:
FYI:
Those components has been worked fine with previous versions of :
And I believed that it's not related to conflicting versions of ember-basic-dropdown, since I've tried the same structure of using our form in another app which is not using ember-basic-dropdown as its dependencies. PS: @abel-n Probably, It's look like the same issue. |
Any update for this issue?Any help would be appreciated ! |
👋, @kaspiZonky and I faced with similar issue today - our component extending add-on's BAD ⛔️ (using pods, but assuming the same applies for classic) // app/components/ui/dropdown/trigger/component.js
import Trigger from 'ember-power-select/components/power-select/trigger';
export default class UiDropdownTriggerComponent extends Trigger {} {{!-- app/components/ui/dropdown/trigger/template.hbs --}}
<div>...</div> GOOD ✅ // app/components/ui/dropdown/trigger/index.js
import Trigger from 'ember-power-select/components/power-select/trigger';
export default class UiDropdownTriggerComponent extends Trigger {} {{!-- app/components/ui/dropdown/trigger/index.hbs --}}
<div>...</div> Hope this helps 🤞 |
@bobisjan @alireza-far However, since then I've started recreating my addon (newest Ember, newest To resolve, I needed to add {
[...]
"ember": {
"edition": "octane"
},
"ember-addon": {
"after": [
"ember-intl",
"ember-power-select"
],
"configPath": "tests/dummy/config"
}
} |
Could please, please, please one of @abel-n post a complete, correct and working configuration to use a custom trigger like it was possible before version 4? I have spent during the last year around 5 days to get this ... trigger component working by trying to combine all the different snippets form this issue, #1422 and the source code after upgrade to version 4.1.6 and I'm about to remove the whole componet from the project. I have a ember addon wrapping the power-select component and at the moment when I'm using the same version of the addon the custom trigger is rendered, in the other project not. Even
renders
in the second project. |
@bmaehr I referenced Passing power select version used in our addon: app folder: export { default } from 'ember-smily-base/components/power-select';
"ember-addon": {
"after": [
"@docfy/ember",
"ember-intl",
"ember-power-select"
],
// [...]
}, |
@abel-n Thank you for your answer. But where are you overriding the trigger component if not with triggerComponent ? |
I finally found out what the problem with |
@bmaehr I prefer doing wrappers (composition) instead of extending or overriding, it tends to be easier to maintain specially templates... like so: https://github.com/prysmex/ember-eui/blob/master/packages/core/addon/components/eui-combo-box/index.hbs |
@betocantu93 is right, unless you want to override a behavior not exposed in any way. And for future reference, the original issue of @bmaehr is not related to |
I'm doing a wrapper and setting
I think this line
ember-truth-helpers
You didn't use the triggerComponent attribute, that's why you didn't have a problem. |
My previous example was from our very complex addon and indeed it is overriding the My very basic reproduction was done on a clean addon / app to ensure there is nothing that affects the test case that shouldn't be there. I pushed the repositories, here is the application you can clone and serve locally to see a fully functional select with custom trigger, no truth helpers added in addon or in consumer app: https://github.com/abel-n/power-select-trigger-override-example-app |
Upgrading our apps from Ember v.3.16 to v.3.20, but I’m not able to use my trigger instead of the default one in the ember-power-select(-multiple).
FYI: there was no issue with overriding triggers in ember v.3.16 since we used ember-power-select v3.0.6
Since there was a bug in ember-basic-dropdown
“TypeError: Cannot read property 'appendChild' of null at BasicDropdown.animateOut”
(this issue has been solved in the library release of v.3.0.0-beta.9.) and Ember-power-select point to that release in its release of v.4.0.0, it's needed to upgrade to Ember-power-select new release which is also compatible with ember v.3.20 (v.4.0.5 and upper)
Since Ember-power-select started using TypeScript from release of 4.0.0 and changed its component structure to using JS and HBS files in the same directory from version 4.0.5, I think there is a conflict with Ember components structure!
I’ve also tried using "triggerComponent" api for rendering our component instead of the default one inside the trigger, but it didn’t work.
I'll be thankful if you help me for addressing this issue.
The text was updated successfully, but these errors were encountered: