diff --git a/src/plugins/events/propchange.js b/src/plugins/events/propchange.js index 36dbf509..ee37f60a 100644 --- a/src/plugins/events/propchange.js +++ b/src/plugins/events/propchange.js @@ -6,6 +6,7 @@ import { symbols } from "xtensible"; import base, { events } from "./base.js"; import { props } from "../props/index.js"; +import PropChangeEvent from "../props/util/PropChangeEvent.js"; const { propchange } = symbols.new; @@ -45,12 +46,13 @@ const hooks = { let propName = this.constructor[propchange][eventName]; let value = this[propName]; - if (value !== undefined) { - this.constructor[props].firePropChangeEvent(this, eventName, { - name: propName, - prop: this.constructor[props].get(propName), - }); + if (value === undefined) { + continue; } + + let prop = this.constructor[props].get(propName); + let detail = { source: "initial", value }; + this.dispatchEvent(new PropChangeEvent(eventName, { name: propName, prop, detail })); } }, };