From 4509ebc56397a66158c49c207f67be015f0cba78 Mon Sep 17 00:00:00 2001 From: Simon Asika Date: Sun, 21 Apr 2024 21:37:45 +0800 Subject: [PATCH] Fix menu edit --- src/Module/Admin/Menu/assets/menu-edit.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Module/Admin/Menu/assets/menu-edit.ts b/src/Module/Admin/Menu/assets/menu-edit.ts index 358d950c..1e1f89dd 100644 --- a/src/Module/Admin/Menu/assets/menu-edit.ts +++ b/src/Module/Admin/Menu/assets/menu-edit.ts @@ -16,7 +16,7 @@ const typeField = u.selectOne('#input-item-type')!; typeField.addEventListener('change', (e) => { if (typeField.value !== '' && typeField.value !== currentType) { - const v = u.$validation.get('#admin-form')[0]; + const v = u.$validation.get('#admin-form')!; v.options.enabled = false; u.form(form).post(null, { task: 'switch_type' }); @@ -28,7 +28,7 @@ const viewField = u.selectOne('#input-item-view')!; viewField.addEventListener('change', (e) => { if (viewField.value !== '' && viewField.value !== currentView) { - const v = u.$validation.get('#admin-form')[0]; + const v = u.$validation.get('#admin-form')!; v.options.enabled = false; u.form(form).post(null, { task: 'switch_type' });