ember-layout icon indicating copy to clipboard operation
ember-layout copied to clipboard

make Ember.LayoutState#parentView property volatile

Open rlivsey opened this issue 12 years ago • 1 comments

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.

rlivsey avatar May 16 '12 15:05 rlivsey

+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')

renajohn avatar May 16 '12 21:05 renajohn