From c0b193554fe8e8a44977ebf662561a68e3dfe573 Mon Sep 17 00:00:00 2001 From: racostas <37309344+racostas@users.noreply.github.com> Date: Wed, 13 Mar 2024 14:40:25 -0400 Subject: [PATCH] [configuration] Fix option deletion issue. (#9121) The handler in configuration/jsx/configuration_helper.js was not properly taking the option to be deleted since the fields not always have necessary to be of SELECT type (they could be also text for example). This updates the code so it should take the appropriate option to be deleted. Fixes #9096 --- modules/configuration/jsx/configuration_helper.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/configuration/jsx/configuration_helper.js b/modules/configuration/jsx/configuration_helper.js index 4be71bf2273..45c6aacc3e8 100644 --- a/modules/configuration/jsx/configuration_helper.js +++ b/modules/configuration/jsx/configuration_helper.js @@ -39,11 +39,9 @@ $(function() { $('.btn-remove').on('click', function(e) { e.preventDefault(); - let options = $(this).parent().parent().children().prop('options'); - let selectedIndex = $(this) - .parent().parent().children() - .prop('selectedIndex'); - let selectedOption = options[selectedIndex].text; + let selectedOption = $(this).parent().parent().children() + .prop('value'); + let fieldName = $(this) .parent().parent().parent().parent().parent().children() .attr('data-original-title');