diff --git a/netbox/project-static/dist/netbox.js b/netbox/project-static/dist/netbox.js index d2af6f39b..5d2d4581d 100644 Binary files a/netbox/project-static/dist/netbox.js and b/netbox/project-static/dist/netbox.js differ diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index bb40896b4..755bed990 100644 Binary files a/netbox/project-static/dist/netbox.js.map and b/netbox/project-static/dist/netbox.js.map differ diff --git a/netbox/project-static/src/objectSelector.ts b/netbox/project-static/src/objectSelector.ts index 9de6c1750..633f5038a 100644 --- a/netbox/project-static/src/objectSelector.ts +++ b/netbox/project-static/src/objectSelector.ts @@ -18,11 +18,12 @@ function handleSelection(link: HTMLAnchorElement): void { const value = link.getAttribute('data-value'); //@ts-ignore - target.slim.setData([ - {text: label, value: value} - ]); - const change = new Event('change'); - target.dispatchEvent(change); + target.tomselect.addOption({ + id: value, + display: label, + }); + //@ts-ignore + target.tomselect.addItem(value); } diff --git a/netbox/project-static/src/select/dynamic.ts b/netbox/project-static/src/select/dynamic.ts index 9f29efe1d..3e934275f 100644 --- a/netbox/project-static/src/select/dynamic.ts +++ b/netbox/project-static/src/select/dynamic.ts @@ -20,7 +20,7 @@ function renderOption(data: TomOption, escape: typeof escape_html) { // Initialize elements with statically-defined options export function initStaticSelects(): void { for (const select of getElements( - 'select:not(.no-ts):not(.api-select):not(.color-select):not([size])', + 'select:not(.tomselected):not(.no-ts):not([size]):not(.api-select):not(.color-select)', )) { new TomSelect(select, { ...config, @@ -17,7 +17,7 @@ export function initStaticSelects(): void { // Initialize color selection fields export function initColorSelects(): void { - for (const select of getElements('select.color-select')) { + for (const select of getElements('select.color-select:not(.tomselected)')) { new TomSelect(select, { ...config, render: {