summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkInput.vue
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2026-01-13 15:02:50 +0900
committerGitHub <noreply@github.com>2026-01-13 15:02:50 +0900
commitf3aa5081ed994af857a97798528e1788d7762d36 (patch)
tree954f29b7743842dc62c76466c200c0dfce885d89 /packages/frontend/src/components/MkInput.vue
parentfix(frontend): add "px" suffix to borderWidth of Ui:C:container (#17088) (diff)
downloadmisskey-f3aa5081ed994af857a97798528e1788d7762d36.tar.gz
misskey-f3aa5081ed994af857a97798528e1788d7762d36.tar.bz2
misskey-f3aa5081ed994af857a97798528e1788d7762d36.zip
fix(frontend): MkFormで入力に不備がある場合は完了ボタンを押して続行できないように (#17096)
* fix(frontend): MkFormで入力に不備がある場合は完了ボタンを押して続行できないように * fix lint
Diffstat (limited to 'packages/frontend/src/components/MkInput.vue')
-rw-r--r--packages/frontend/src/components/MkInput.vue5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/frontend/src/components/MkInput.vue b/packages/frontend/src/components/MkInput.vue
index 4f6ca083a3..8a49fd231d 100644
--- a/packages/frontend/src/components/MkInput.vue
+++ b/packages/frontend/src/components/MkInput.vue
@@ -92,6 +92,7 @@ const emit = defineEmits<{
(ev: 'keydown', _ev: KeyboardEvent): void;
(ev: 'enter', _ev: KeyboardEvent): void;
(ev: 'update:modelValue', value: ModelValueType<T>): void;
+ (ev: 'savingStateChange', saved: boolean, invalid: boolean): void;
}>();
const { modelValue } = toRefs(props);
@@ -152,6 +153,10 @@ watch(v, () => {
invalid.value = inputEl.value?.validity.badInput ?? true;
});
+watch([changed, invalid], ([newChanged, newInvalid]) => {
+ emit('savingStateChange', newChanged, newInvalid);
+}, { immediate: true });
+
// このコンポーネントが作成された時、非表示状態である場合がある
// 非表示状態だと要素の幅などは0になってしまうので、定期的に計算する
useInterval(() => {