fix: redirects user on selection
This commit is contained in:
@@ -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]}`
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user