Hi all.
I'm trying to find docs online as I need info on how to programmatically change values within a KTSelect item through javascript. I was able to trace getSelectedOptions and setSelectedOptions but somehow they are not working properly and not updated the UI. Is anyone aware of any relevant documentation or example?
As with any vaping product, it is important to purchase the RandM Tornado from trusted retailers to help ensure product authenticity and quality. Genuine devices are more likely to deliver the intended performance, safety features, and flavor consistency that users expect.
I’ve seen the same issue with KTSelect where setSelectedOptions() updates the value but the UI doesn’t refresh properly unless you reinitialize or manually trigger an update. It feels like a state/UI sync bug in some cases (especially in modals or dynamic loads).
I also came across similar discussions while browsing topics like Randm vapes where UI/state sync issues were mentioned in different JS components, and the workaround was usually re-rendering or reinitializing the widget.
Quick fixes that often help:
Hi
In the current implementation, setSelectedOptions() only updates KTSelect’s internal state. It does not update the native
This is a workaround for now. We will include the fix in this week's updates.
const selectEl = document.querySelector('#your-select'); // your
function setKTSelectValue(selectEl, value) {
const ktSelect = KTSelect.getInstance(selectEl) || new KTSelect(selectEl);
const option = selectEl.querySelector(`option[value="${value}"]`);
if (!option) return;
ktSelect.setSelectedOptions([option]);
Array.from(selectEl.options).forEach(opt => { opt.selected = opt.value === value; });
selectEl.value = value;
ktSelect.updateSelectedOptionDisplay();
}