ember-power-select icon indicating copy to clipboard operation
ember-power-select copied to clipboard

More ergonomic customization for selected item in trigger (:named blocks)

Open nfagerlund opened this issue 2 years ago • 1 comments

PowerSelect's @selectedItemComponent argument is incredibly useful! But it's also awkwardly indirect, and requires making a whole one-off component; a very "old ember" sort of idiom.

Instead, I'd really like to be able to use an optional <:selectedItem> named block for this. It would be much more convenient for little one-off tweaks to the select trigger, and much more legible to future maintainers of my template code.

nfagerlund avatar Sep 01 '23 18:09 nfagerlund

Look into template imports. https://github.com/ember-template-imports/ember-template-imports. I am creating all new components this way and trying my best to convert over old ones quickly. Love it.

It makes this a whole lot easier. You no longer need to create a separate component in a separate file. You could define the trigger as a private component in the same file (unless you needed the trigger in multiple places, then you would still need to create a separate component)

cah-brian-gantzler avatar Sep 01 '23 18:09 cah-brian-gantzler

I confirm, that the classic component way is/was always more work for consumer app.

With custom components we bring more flexibility then with named blocks and with the next gen component format (which can already used today and will be the future recommended way for components) i think we don't need to extend the addon with named block logic.

mkszepp avatar Mar 15 '24 15:03 mkszepp