Sort: set default option without opening dropdown

i want to have a default option in my sort dropdown.
i have created a script but that is not working good.
i have created a second click to close dropdown but its not working without delay, but now you see a flicker of the dropdown. also when reloading couple times the default sort click doesnt work anymore and then the click of the dropdown is only working. you will see a openend dropdown on page load

window.onload = function() {
    // Click the first filter option immediately
    var firstFilter = document.querySelector('.first-filter-option');
    if (firstFilter) {;

    // Delay the click on the filter_dropdown-sort by 100 milliseconds
    setTimeout(function() {
        var dropdownSort = document.querySelector('.filter_dropdown-sort');
        if (dropdownSort) {
    }, 100);


Hey @aardigamsterdam! You can use a combo of CMS Sort and Custom Form Select Field for Webflow where the first value from your select element will be the default sorting.