diff --git a/src/Resources/assets/admin/automaticBlacklistingConfiguration.js b/src/Resources/assets/admin/automaticBlacklistingConfiguration.js index bca19c4..1a3bfe1 100644 --- a/src/Resources/assets/admin/automaticBlacklistingConfiguration.js +++ b/src/Resources/assets/admin/automaticBlacklistingConfiguration.js @@ -1,15 +1,14 @@ -$(() => { - const addRuleBtn = document.querySelector('[data-form-collection="add"]'); +const addRuleBtn = document.querySelector('[data-form-collection="add"]'); - const turnOnListener = () => { - addRuleBtn?.addEventListener('click', () => { +const turnOnListener = () => { + addRuleBtn?.addEventListener('click', () => { + setTimeout(() => { const configurationTypeSelects = document.querySelectorAll('[data-form-collection="update"]'); const changeEvent = new Event('change', { 'bubbles': true }); - + configurationTypeSelects[configurationTypeSelects.length - 1].dispatchEvent(changeEvent); - }); - } - - turnOnListener(); -}) + }, 100); + }); +} +turnOnListener();