@ditojs/admin 2.2.3 → 2.2.5

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.5",
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": "7d19908fc86cbc1367cdd07753f8d80cf159fa2c",
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,21 @@ export default {
297
298
  },
298
299
 
299
300
  onChange() {
301
+ const value =
302
+ this.parsedValue !== undefined ? this.parsedValue : this.value
303
+
304
+ if (this.$options.nativeField) {
305
+ // For some odd reason, the native change event now sometimes fires
306
+ // twice on Vue3. Filter out second call.
307
+ // TODO: Investigate why this happens, and if it's a bug in Vue3.
308
+ if (value === this.changedValue) return
309
+ this.changedValue = value
310
+ }
311
+
300
312
  this.markDirty()
301
313
  this.emitEvent('change', {
302
- context:
303
- this.parsedValue !== undefined
304
- ? { value: this.parsedValue }
305
- : null,
314
+ // Prevent endless parse recursion:
315
+ context: { value },
306
316
  // Pass `schemaComponent` as parent, so change events can propagate up.
307
317
  parent: this.schemaComponent
308
318
  })