Mobile Dropdown - you must click twice to trigger

Cindy L (naassist)

May 22, 2019 1:26 AM (UTC-04:00)

Mobile Dropdown - you must click twice to trigger

I am developing a web site for a real estate team. On our Sold page I have given the user an option with a dropdown menu to sort the database repeater to show only sold homes via cities. This works great on the desktop version, but on the mobile version, you must tap the dropdown menu 2x to get the results you are looking for. My site: https://naassist.wixsite.com/nevisandardizzone/solds
My code:
import wixData from ‘wix-data’;
export function displayCity_click(event) {
let searchCity = $w(“#displayCity”).value;
if (searchCity === “RESET”){
$w(“#dataset1”).setFilter(wixData.filter()
.eq(“sold”,true));
}
else{
$w(“#dataset1”).setFilter(wixData.filter()
.eq(“sold”, true)
.contains(“city”, searchCity)
)
}
}

For more information go to Wix Help Center

500 Terry A Francois Blvd San Francisco, CA 94158

Instead of onClick, try onChange and add a small timeout before you pull the value. [use setTimeout() ]

P.S. even 10ms should be enough.
But try it first even without the timeout. It may work anyway. Only change to onChange.

Thank you for your quick response. Just using the onChanged worked.

Hello! This is exactly the issue I’m having… though I’m not sure exactly how to implement the switch to “OnChange”

Here is how this part of the code exists now:

export function dropdown1_click(event, $w) {
let SearchValue = $w(“#dropdown1”).value;
$w(“#dataset1”).setFilter(wixData.filter().contains(‘category’, SearchValue));
}