@ditojs/admin 2.2.3 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/admin",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "type": "module",
5
5
  "description": "Dito.js Admin is a schema based admin interface for Dito.js Server, featuring auto-generated views and forms and built with Vue.js",
6
6
  "repository": "https://github.com/ditojs/dito/tree/master/packages/admin",
@@ -82,7 +82,7 @@
82
82
  "vite": "^4.3.1"
83
83
  },
84
84
  "types": "types",
85
- "gitHead": "7102747103c7d60e9fffca44ca6ae459bea67cc1",
85
+ "gitHead": "4812f8f5f86ad6a33b7f7a3585442e7acf444637",
86
86
  "scripts": {
87
87
  "build": "vite build",
88
88
  "watch": "yarn build --mode 'development' --watch",
@@ -25,6 +25,7 @@ export default {
25
25
  data() {
26
26
  return {
27
27
  parsedValue: null,
28
+ changedValue: null,
28
29
  focused: false
29
30
  }
30
31
  },
@@ -297,12 +298,19 @@ export default {
297
298
  },
298
299
 
299
300
  onChange() {
301
+ const value =
302
+ this.parsedValue !== undefined ? this.parsedValue : this.value
303
+
304
+ // For some odd reason, the native change event now sometimes fires twice
305
+ // on Vue3. Filter out second call.
306
+ // TODO: Investigate why this happens, and if it's a bug in Vue3.
307
+ if (value === this.changedValue) return
308
+ this.changedValue = value
309
+
300
310
  this.markDirty()
301
311
  this.emitEvent('change', {
302
- context:
303
- this.parsedValue !== undefined
304
- ? { value: this.parsedValue }
305
- : null,
312
+ // Prevent endless parse recursion:
313
+ context: { value },
306
314
  // Pass `schemaComponent` as parent, so change events can propagate up.
307
315
  parent: this.schemaComponent
308
316
  })