Hello guys, I have a selection menu working with tags. I would like that when I select a new voice, it will automatically deselect the previous one and then update the content. Now it just adds the new products even if the tag is not the one selected. Can anyone help me?
The code that I already have is this:
Are you searching for a “Single-Tag-Selection” ???
If so, take a look onto this one…
The included EXAMPLE will not work anymore (since i have deleted some stuff on my site) but you can read the post, which will show you how to achieve your wished functionality.
I just tried to add the code in my site, it works but the selection remembers the previous tag selection. I saw the reply that you have to use the cose, but how? Thank you for your help!
The code is now the following: import wixData from ‘wix-data’ ;
@emilianogiovannini0 Maybe you have other code on the page that makes the problem.
But the code I posted should work (if you used the correct property IDs, of course).
If you put my code inside $w.onReady and you don’t have other (buggy) code on your page.
You should look at the console for errors.
@emilianogiovannini0 It should take the current value array, reverse its order, take the first item (which is the last to be selected), put it in an empty array and assign it to the tags value.
I don’t know why it doesn’t work for you, but it worked for me when I tried it a long time ago.
Hello,
it’s almost two years that this code is working. Today randomly it just stopped, code is working on the editor but not on the actual public site. Are there any known bugs?