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

Allow Objects as Values For Select Component #44

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

rtablada
Copy link

This implements both #30 and #31.

For implementation this uses a yielded child component which also gives an upgrade path for users of embers-select (a mostly deprecated community component).

There is a breaking change since this changes the order of arguments sent to onChange (#30) and sends the full object value of the selection option rather than the string attr value.

@rtablada
Copy link
Author

Merging this would close #43

Copy link

@hergaiety hergaiety left a comment

Choose a reason for hiding this comment

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

Took a glance at the code and it's looking really really good. Would recommend going in and cleaning up the indentation as in github it looks like things are at different indentation levels. Could be an IDE difference.

That along with some documentation upgrades, and I'll clone things down locally just to double check stuff, but this looks great and should be mergable soon I imagine.

EDIT: By the way, CI will likely fail due to #42 but that won't block us from merging this PR, we'll just make note of what Ember versions are supported and address that issue separately.

import Component from '@glimmer/component';


export default class SelectLightOption extends Component {

Choose a reason for hiding this comment

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

I love seeing this logic extracted to its own sub component, well done!

tests/integration/components/select-light-test.js Outdated Show resolved Hide resolved
tests/integration/components/select-light-test.js Outdated Show resolved Hide resolved
@rtablada
Copy link
Author

Updated whitespace in the effected files to match the standard Ember editorconfig (2 spaces). The test file had some existing mixed tabs and spaces.

Will look at docs in the morning!

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