fix(settings): prevent setting input done button from animating initially when mounting

This commit is contained in:
2026-07-24 12:17:48 +02:00
parent f81ce63062
commit 9ce4cec0bf
@@ -38,6 +38,8 @@ const store = useSettingsStore();
const inputModel = ref(store.get(props.path)); const inputModel = ref(store.get(props.path));
let oldInputValue = inputModel.value; let oldInputValue = inputModel.value;
const doneButtonInitial = ref(true);
const inputId = useId(); const inputId = useId();
const inputLabelId = useId(); const inputLabelId = useId();
@@ -59,6 +61,10 @@ watch(store, (newValue) => {
}; };
}); });
watch(inputModel, () => {
doneButtonInitial.value = false;
});
const apply = function apply () { const apply = function apply () {
store.set(props.path, inputModel.value); store.set(props.path, inputModel.value);
}; };
@@ -82,7 +88,9 @@ const apply = function apply () {
class="input" class="input"
/> />
<button <button
ref="doneButton"
class="done-button button" class="done-button button"
:class="{ initial: doneButtonInitial }"
type="submit" type="submit"
:title="t('settings.input.done.title')" :title="t('settings.input.done.title')"
:aria-label="t('settings.input.done.ariaLabel')" :aria-label="t('settings.input.done.ariaLabel')"
@@ -141,6 +149,9 @@ const apply = function apply () {
border-radius: calc(var(--input-padding) + 13px); border-radius: calc(var(--input-padding) + 13px);
font-size: 1em; font-size: 1em;
font-family: inherit; font-family: inherit;
}
.done-button:not(.initial) {
animation: done-button-disappear var(--total-animation-duration); animation: done-button-disappear var(--total-animation-duration);
} }