|
@@ -74,24 +74,36 @@ function handleRoot(el, Alpine) {
|
|
|
|
|
|
this.__context = generateContext(this.__isMultiple)
|
|
|
|
|
|
+
|
|
|
+
|
|
|
queueMicrotask(() => {
|
|
|
this.__ready = true
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
queueMicrotask(() => {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
let lastValueFingerprint = false
|
|
|
|
|
|
Alpine.effect(() => {
|
|
|
if (lastValueFingerprint !== false && lastValueFingerprint !== JSON.stringify(this.__value)) {
|
|
|
- console.log('changed value, select keys')
|
|
|
+
|
|
|
this.__context.selectValue(this.__value, this.__compareBy)
|
|
|
} else {
|
|
|
- console.log('changed keys, select value')
|
|
|
+
|
|
|
this.__value = this.__context.selectedValueOrValues()
|
|
|
}
|
|
|
|
|
|
- this.__inputName && renderHiddenInputs(this.$el, this.__inputName, this.__value)
|
|
|
-
|
|
|
+
|
|
|
lastValueFingerprint = JSON.stringify(this.__value)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.__inputName && renderHiddenInputs(this.$el, this.__inputName, this.__value)
|
|
|
})
|
|
|
})
|
|
|
})
|