LT-67: Fixing change event bubbling on formItem mixin

This commit is contained in:
Bruno Alves de Faria 2016-08-31 13:57:22 -03:00
parent 6e84a388b6
commit c4ac8cbeef
2 changed files with 11 additions and 3 deletions

View File

@ -160,9 +160,18 @@ OHIF.mixins.formItem = new OHIF.Mixin({
events: {
// Enable reactivity by changing a Tracker.Dependency observer
// Handle the change event for the component
change(event, instance) {
instance.component.changeObserver.changed();
const component = instance.component;
// Prevent execution on upper components
if (event.currentTarget === component.$element[0]) {
// Enable reactivity by changing a Tracker.Dependency observer
component.changeObserver.changed();
// Revalidate the component
component.validate();
}
},
// TODO: [design] remove log, show error box/hint over the wrapper

View File

@ -30,7 +30,6 @@ const getCurrentSchema = (parentComponent, key) => {
// Merge the sub-schema properties if it's an array
if (Array.isArray(currentSchema.type())) {
console.warn('>>>>IS ARRAY', currentSchema);
_.extend(currentSchema, schema._schema[key + '.$']);
}