Change the text of the selected dropdown entry


Any ideas about how I can change the text of the shown dropdown value. I can change the text of the sp-menu-item inside of it, but the selected text won’t update.

Here’s the code that I use to change the text (the first line doesn’t work) …

 document.getElementById("dropdown_presets").value = presetname;
      document.getElementById("dropdown_presets").selectedOptions[0].innerText = presetname;

It works when I reassign the innerHTML content.
document.getElementById("dropdown_presets").firstElementChild.innerHTML = document.getElementById("dropdown_presets").firstElementChild.innerHTML;

But this looks like “I suck at Javascript”. Is there a proper way?

And here’s that ugly textfield bug. Can’t this be fixed?