Fix accept animation in chrome

This commit is contained in:
Julian Stirling 2025-08-28 17:21:51 +01:00
parent 212b8fe062
commit acb24d9713

View file

@ -11,6 +11,7 @@
@focusin="focusIn" @focusin="focusIn"
@focusout="focusOut" @focusout="focusOut"
@keydown="keyDown" @keydown="keyDown"
@animationend="animationEnd"
/> />
<sync-property-button @click="requestUpdate" /> <sync-property-button @click="requestUpdate" />
</div> </div>
@ -42,6 +43,7 @@
@focusin="focusIn" @focusin="focusIn"
@focusout="focusOut" @focusout="focusOut"
@keydown="keyDown" @keydown="keyDown"
@animationend="animationEnd"
/> />
<sync-property-button @click="requestUpdate" /> <sync-property-button @click="requestUpdate" />
</div> </div>
@ -60,6 +62,7 @@
@focusin="focusIn" @focusin="focusIn"
@focusout="focusOut" @focusout="focusOut"
@keydown="keyDown" @keydown="keyDown"
@animationend="animationEnd"
/> />
<sync-property-button @click="requestUpdate" /> <sync-property-button @click="requestUpdate" />
</div> </div>
@ -139,10 +142,6 @@ export default {
animate(updated) { animate(updated) {
if (updated) { if (updated) {
this.animateUpdate = true; this.animateUpdate = true;
setTimeout(() => {
this.animateUpdate = false;
this.$emit('animationShown');
}, 700);
} }
} }
}, },
@ -239,6 +238,10 @@ export default {
updateIsEdited: function() { updateIsEdited: function() {
this.isEdited = this.deepStringify(this.internalValue) !== this.deepStringify(this.value); this.isEdited = this.deepStringify(this.internalValue) !== this.deepStringify(this.value);
}, },
animationEnd: function() {
this.animateUpdate = false;
this.$emit('animationShown');
},
deepStringify: function(val) { deepStringify: function(val) {
if (Array.isArray(val)) { if (Array.isArray(val)) {
return JSON.stringify(val.map(String)); return JSON.stringify(val.map(String));
@ -280,5 +283,7 @@ export default {
} }
.flash { .flash {
animation: green-flash 0.7s ease; animation: green-flash 0.7s ease;
/*Without this background-colour chrome will ignore the animation colour.*/
background-color: white;
} }
</style> </style>