Editing dialog while open

I have a dialog element, that has a select tag with id of dropdown. I also have an array of strings called fileNames. I want to add each item in filenames as an option in the dropdown.
When I create an option element, fill it with the proper attributes and log it to the console, it looks normal. However, when I try to append it to the select element, I get “torq::ui::TorqComboBoxItem” as the innerText, and I believe that the value is empty.

Here is my code:

fileNames.forEach((name, i) => {
     let option = document.createElement('option');
     option.innerText = name;
     option.value = fileList[i].name; /*Get file names from somewhere else*/
     document.getElementById('dropdown').appendChild(option);
})

I used innerHTML instead of innerText, and it worked perfectly! Go figure.

Oh. That’s… super strange. It shouldn’t make a difference.
What version XD and OS?

1 Like

@kerrishotts
I can confirm that on Win10, XD 19, I’m “still” (and always have been) experiencing problems when using innerText for plugins. I’m always just using innerHTML since innerText has never worked for me (and I – every few programming sessions – have to change a line of code when realizing I used innerText, so I can at least confirm that it isn’t working the way it’s supposed to (and always has been that way :wink:)