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

{{one-way-select}} incompatible with with ember-modal-dialog animation #168

Closed
Turbo87 opened this issue Sep 8, 2017 · 1 comment
Closed

Comments

@Turbo87
Copy link
Contributor

Turbo87 commented Sep 8, 2017

We are using {{one-way-select}} inside of an ember-modal-dialog and are animating that dialog using liquid-fire (via liquid-wormhole). Unfortunately during the animation the select box will always select the first element in the list instead of the selected one. Once the animation has settled the correct option is selected.

I've traced this down to the selected attribute in <option selected={{isSelected}}> not being set properly on the DOM node (see also https://stackoverflow.com/questions/41839681/how-can-i-dynamically-set-the-selected-attribute-on-an-option-tag). Since liquid-fire appears to clone the modal DOM for animation the cloned <option> will not have the selected attribute set on it, which causes the select box to default to the first entry.

tl;dr https://github.com/DockYard/ember-one-way-controls/blob/v2.0.1/addon/templates/components/one-way-select/option.hbs#L2 is not quite working as expected

A possible solution is something like

{{#if isSelected}}
  <option selected>foo</option>
{{else}}
  <option>foo</option>
{{/if}}

which seems to be animated properly.

/cc @cibernox @ef4 @pzuraq

@Turbo87
Copy link
Contributor Author

Turbo87 commented Sep 13, 2017

closing in favor of ember-animation/liquid-fire#586

@Turbo87 Turbo87 closed this as completed Sep 13, 2017
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

No branches or pull requests

1 participant