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

pagedArray computed helper doesn't pass the contentProperty attr to computed #281

Closed
jeneve opened this issue Jan 17, 2020 · 2 comments
Closed

Comments

@jeneve
Copy link

jeneve commented Jan 17, 2020

I am wondering why the pagedArray computed helper doesn't pass contentProperty to computed?

return Ember.computed("",function() {

I have a component:

import { alias } from '@ember/object/computed'
import Component from '@ember/component'
import hbs from 'htmlbars-inline-precompile'
import pagedArray from 'ember-cli-pagination/computed/paged-array'

export default Component.extend({
  tagName: '',

  content: null,
  layout: hbs`{{yield (assign pagedContent)}}`,
  page: 1,
  perPage: 30,

  pagedContent: pagedArray('content', {
    page: alias('parent.page'),
    perPage: alias('parent.perPage'),
  }),
})

Which when passed a changed content property does not yield back an updated pagedContent property.

The problem is fixed by either:

didRecieveAttrs() {
  this.notifyPropertyChange('pagedContent')
}

OR

layout: hbs`{{yield (assign pagedContent foo=content)}}`,

both of which lead me to think maybe the above referenced line is the culprit, but I may be missing some context?

@broerse
Copy link
Collaborator

broerse commented Jan 17, 2020

Try it with Ember 3.12 It seems the problem started with Ember 3.13+

See: emberjs/ember.js#18689

We are working on it and hope to fix it soon.

@broerse
Copy link
Collaborator

broerse commented Jan 31, 2020

The fix is merged in Ember Canary See: emberjs/ember.js#18703 So the options are running Ember 3.12 or Ember Canary

@broerse broerse closed this as completed Jan 31, 2020
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

2 participants