-
Notifications
You must be signed in to change notification settings - Fork 176
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
When used in nested views, outer views should not receive change-events that stickit has handled #246
Comments
I haven't used Marionette in many moons. Mind creating a jsfiddle to show what you mean? |
I don't really think this would be a good idea to do by default. There are many cases in which outer views depend on events bubbled up from inner views, even if some handler in those inner views has already responded. If a feature like this were to be implemented, I'd suggest that it would be best to do it as a flag in the binding config, like // ...
update: function($el, value) {
/* snip */
},
getVal: function($el) {
/* snip */
},
consumeEvents: true //default false
} // end of binding config |
Using
One should use |
Using stickit in a Marionette Composite view, the outer instance of the view is seeing and honoring events from an inner view because the inner view's stickit's default updateModel() just returns true. If we change the default behavior to { event.stopPropagation(); return true; }, this problem goes away.
This isn't specific to Marionette - it's just an example where composed views get leakage of the events that stickit has already handled. Not that a coder couldn't override the newly-proposed default to restore earlier non-stopPropagation behavior if valuable.
The text was updated successfully, but these errors were encountered: