Prevent field flash on resize

This commit is contained in:
rijkvanzanten
2020-07-31 18:12:57 -04:00
parent 42e0e790c5
commit 1809f64ddd
3 changed files with 5 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div :class="hidden ? 'half' : field.system.width">
<div :class="field.system.width || 'full'">
<v-menu attached close-on-content-click>
<template #activator="{ toggle, active }">
<v-input class="field" :class="{ hidden, active }" readonly @click="toggle">

View File

@@ -36,6 +36,7 @@
v-for="field in sortedHiddenFields"
:key="field.field"
:field="field"
hidden
@toggle-visibility="toggleVisibility($event, 'hidden')"
@edit="openFieldSetup(field)"
/>

View File

@@ -156,15 +156,14 @@ export const useFieldsStore = createStore({
// Update locally first, so the changes are visible immediately
this.state.fields = this.state.fields.map((field) => {
if (field.collection === collectionKey && field.field === fieldKey) {
return {
...field,
...updates,
};
return merge({}, field, updates);
}
return field;
});
// Save to API, and update local state again to make sure everything is in sync with the
// API
try {