From b8564fad1b80ddd0e45c66114a61c690a2d46af0 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Fri, 24 Jan 2025 14:55:53 +0000 Subject: [PATCH] Attempt at a fix for the test --- src/main/js/add-item.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/js/add-item.js b/src/main/js/add-item.js index 57fffc89d8..3b0e98c1cd 100644 --- a/src/main/js/add-item.js +++ b/src/main/js/add-item.js @@ -106,9 +106,12 @@ document.addEventListener("DOMContentLoaded", () => { } function cleanCopyFromOption() { - document - .querySelector('#createItem input[type="radio"][value="copy"]') - .removeAttribute("checked"); + const copyRadio = document.querySelector( + '#createItem input[type="radio"][value="copy"]', + ); + if (copyRadio) { + copyRadio.removeAttribute("checked"); + } document.querySelector( '#createItem input[type="text"][name="from"]', ).value = "";