From 3c696e1724cf70648ecde0d92d001085ea3c1fb2 Mon Sep 17 00:00:00 2001 From: Carmen Alvarez Date: Thu, 26 Sep 2024 12:58:24 +0200 Subject: [PATCH] Empty the recipes list, before re-populating it with recipes. --- example/geny-window.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/example/geny-window.js b/example/geny-window.js index 8d33b3d..408b479 100644 --- a/example/geny-window.js +++ b/example/geny-window.js @@ -155,6 +155,8 @@ const fetchRecipes = async () => { } const selectElement = document.querySelector('#listRecipes'); + // Empty the select before adding new options. + selectElement.innerHTML = ''; const placeholderOption = document.createElement('option'); placeholderOption.textContent = 'Select a recipe'; placeholderOption.value = '';