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

Modal closes on first change on model when in component within table #487

Closed
1 of 3 tasks
dcharles525 opened this issue Apr 12, 2022 · 3 comments
Closed
1 of 3 tasks

Comments

@dcharles525
Copy link

dcharles525 commented Apr 12, 2022

  • I'm submitting a ...

  • What is the current behavior?
    Currently, I have an edit button that opens an ember-bootstrap modal. This modal allows the user to edit the record in the row. However, when any value in the record (model) is changed, the modal gets hidden. I have even tried setting it manually to never close. I believe this is the table refreshing and the component is getting reset? After the first change, I can reopen the modal and it stays open as intended.

  • Please tell us about your environment:

  • ember-models-table version: 3.4.0
  • ember version:
  • ember-data version: 3.25.0
  • ember-cli version: 3.25.2
  • node version: 14.15.0
  • npm version: 6.14.8
  • ember-bootstrap version: 4.9.0
@onechiporenko
Copy link
Owner

Hello, @dcharles525. Could you please provide a demo with reproduction? It's pretty hard to get what was wrong without it. Thanks

@dcharles525
Copy link
Author

@onechiporenko I was actually able to figure this out. Since the models were being passed to the component via a getter that was filtering out certain models, it needed a @computed decorator to stop it from closing the modal on initial change.

@cah-brian-gantzler
Copy link

@computed has been deprecated. If you are on Ember 4.1+ You should use the @cache emberjs/ember.js#19826. If you are on a version prior to Ember 4.1 you should use @cache from https://github.com/ember-polyfills/ember-cached-decorator-polyfill

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants