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

make Ember.LayoutState#parentView property volatile #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rlivsey
Copy link
Contributor

@rlivsey rlivsey commented May 16, 2012

Properties are cached by default when Ember.CP_DEFAULT_CACHEABLE is true, which will be the default in Ember 1.0

This causes the parentView property to never change, causing content to be set on the incorrect view on subsequent changes leading to blank sections.

This change just makes the parentView property volatile.

@renajohn
Copy link

+1
I've just stumble on that one. Nice catch!

Another solution is to make parentView depends on parentState.view:

  parentView: Ember.computed(function() {                                       
    var state = this.get('parentState');                                        
    while(state && !state.get('view')) {                                        
      state = state.get('parentState');                                         
    }                                                                           
    return state && state.get('view');                                          
  }).property('parentState.view')

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