I have a text input with a hidden repeater under it that will appear when the user starts typing in the input. The repeater shows a list of suggested addresses the user can click on to use in the input. All this works fine, but the repeater pushes everything below it down.
Is there a way to make a repeater behave more like a drop down menu? Instead of pushing all the elements under it down, I want it to flow over the elements like a drop down menu. I’d settle for being able to open a drop down menu with code instead of a user click. Or any other way to accomplish a menu that has a dynamic number of items in it that doesn’t push the elements below it down.
Yes, you can.
Put the repeater inside a box and make sure the box significantly overlaps (as top layer) of the element below. Make the box collapsed as default, expand it onInput() and collapse it onBlur()
That worked perfectly. Thank you so much. Unfortunately, the purpose of the drop-down is for users to click on it to populate the input field. However, the onBlur from the input seems to fire first, so the dropdown gets collapsed before the mouse click fires. Also, the drop-down doesn’t block the elements underneath. I can easily disable them when the drop down expands but it seems like there should be a cleaner way of making the menu block the elements beneath it. At any rate, your solution gave me something to work with I didn’t have before so thanks again for your help.
Thanks for the suggestion. Something always goes wonky when I try to open example sites in the editor. I have tried turning off all browser extensions, turning off anti-virus and firewall, deleting my browser cache, opening examples with another account, opening examples in a different browser (Chrome, Firefox, and Edge) and opening examples in an incognito window.
Edit: Forgot to mention that I tried all of the above on my PC as well as my girlfriend’s laptop.
Generally, it loads most of the design elements, though sometimes not even the design elements, but I can never see or open any code. For the first time since I started learning Wix, I actually got your repeater dropdown example to open well enough to copy and paste the code into a text editor, although when I try to preview the page from the editor, I get:
@jonatandor35 Thanks for the reply. I was thinking along these same lines but your solution is more elegant than mine was.
Edit: After implementing this in my code, it didn’t work. I tried several things but it wound up just being the timeout is too short. I set it to 100ms instead of 20 and it works perfectly.