From 95e0b2e796239b6591b741d634a6f860ca391a19 Mon Sep 17 00:00:00 2001 From: Super12138 <70494801+Super12138@users.noreply.github.com> Date: Sat, 28 Sep 2024 22:28:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A3=80=E6=9F=A5=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E6=98=AF=E5=90=A6=E9=80=89=E6=8B=A9=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/index.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/test/index.ts b/src/test/index.ts index 5c1db52..24d5ce3 100644 --- a/src/test/index.ts +++ b/src/test/index.ts @@ -7,7 +7,6 @@ import 'mdui/components/radio.js'; import type { Button } from 'mdui/components/button.js'; import type { LinearProgress } from 'mdui/components/linear-progress.js'; -import type { RadioGroup } from 'mdui/components/radio-group.js'; import type { TopAppBarTitle } from 'mdui/components/top-app-bar-title.js'; import '@mdui/icons/arrow-back--outlined.js'; @@ -138,16 +137,16 @@ document.addEventListener('testPageLoaded', async () => { }; function checkQuestionChecked(id: number) { - const radioGroup: RadioGroup = document.querySelector(`#questions-${id}`)!; - if (radioGroup.value) { + const checkQuestion = questions[id - 1].html.querySelector('mdui-radio-group')!; + if (checkQuestion.value) { nextBtn.disabled = false; } else { nextBtn.disabled = true; const radioChangeListener = () => { nextBtn.disabled = false; - radioGroup.removeEventListener('change', radioChangeListener); + checkQuestion.removeEventListener('change', radioChangeListener); }; - radioGroup.addEventListener('change', radioChangeListener); + checkQuestion.addEventListener('change', radioChangeListener); } }