question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to render a trigger component instead of the default one in new release of ember-power-select.

See original GitHub issue

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).

    "ember-cli": "3.20.2",
    "ember-cli-babel": "7.21.0",
    "ember-basic-dropdown": "3.0.12",
    "ember-power-select": "4.1.2",
    "ember-concurrency": "1.0.0",
    "ember-concurrency-decorators": "2.0.3",

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.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bobisjancommented, Apr 23, 2021

👋, @kaspiZonky and I faced with similar issue today - our component extending add-on’s trigger was ignoring custom template. Since the add-on’s components are co-located now, we were able to fix the issue by co-locating our component as well.

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 🤞

1reaction
betocantu93commented, Nov 22, 2021

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - Ember Power Select
This will make the list of options be placed next to the trigger instead of being attached to the body, and therefore it...
Read more >
Ember-power-select not working with 3.20
I've updated ember-power-select to latest. Here's an example of how I am using it {{#power-select-extend triggerClass="ui dropdown search selection no-bottom- ...
Read more >
javascript - ember-power-select Custom Search Action and ...
I'm going to answer showing some diffs with the changes required to make the select work in your repo: ...
Read more >
ember-power-select | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >
Customising Ember Power Select - Medium
The trigger is rendered without any surrounding markup. ... it to the components you are using to override the default trigger and options....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found