fix: redirects user on selection

This commit is contained in:
2025-07-06 09:31:47 -05:00
parent eafcf3fcb1
commit 023b1b7844
3 changed files with 8 additions and 5 deletions

View File

@@ -20,8 +20,10 @@ export default class extends Controller {
_onPreConnect(event) {
// TomSelect has not been initialized - options can be changed
console.log(event.detail.options); // Options that will be used to initialize TomSelect
event.detail.options.onChange = (value) => {
// ...
event.detail.options.onItemAdd = (value, $item) => {
console.log(value, $item)
const params = value.split('|')
window.location.href = `/result/${params[0]}/${params[1]}`
};
}