Skip to content

Commit

Permalink
[configuration] Fix option deletion issue. (#9121)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
racostas authored Mar 13, 2024
1 parent df103b6 commit c0b1935
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions modules/configuration/jsx/configuration_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit c0b1935

Please # to comment.