search /reload table doesn't work on IOS

Hi,

For a basket-ball club, I have a page with a table, dataset and match collection, and a “season” dropdown allowing to choose the season (2018-2019 …). Some columns allow for sorting (“date”, “équipe” and “adversaire”) with a click on the column header.

Live website :
https://www.collongebasketclub.net/

Everything works fine on windows and Androïd, but not on Ipad nor Iphone (IOS 12.2), with Javascript enabled in Safari of course : the match table loads, but without any filtering. And choosing a season in the dropdown doesn’t filter the table. Moreover, clicking on the table headers does not sort the table (quite expected as the same

function search_dataset1(tri, saison) 

function is called for all these tasks). Here is the code involved (without the column header-click events):

export function dropdown1_change(event) {   // reloads the table according to season chosen from dropdown
    $w('#dataset1').onReady(() => {
        search_dataset1('dateHeure', $w('#dropdown1').value) // f call
    })
}

export function dataset1_ready() { // refreshes the "season" dropdown according to last table data at end of dataset load
 let tableRows = $w('#table1').rows;
 var dt0 = tableRows[0]['dateHeure'];
 var dt = Date(tableRows[0]['dateHeure'].valueOf());
 var Year = dt.substring(11,15);
 if (dt0 < new Date(Year,8,1)) {
 var Year0 = Year;
        --Year;
        $w('#dropdown1').value = Year+'-'+Year0;} 
 else {
 var Year1 = Year;
        ++Year;
        $w('#dropdown1').value = Year1+'-'+Year;}
    search_dataset1('dateHeure', $w('#dropdown1').value);  // f call
}

function search_dataset1(tri, saison){
 if (saison === '') {
        $w("#dropdown1").selectedIndex = 0;
 var dpd = $w('#dropdown1').value;
        }
 else {
 var dpd = saison;
        }
 var lowerYear = dpd.substring(0,4);
 var upperYear = dpd.substring(5,9);
        lowerDate = new Date(lowerYear.concat('-','8','-','1'));
        upperDate = new Date(upperYear.concat('-','7','-','30'));
 if (tri==='dateHeure'|| tri==='') {
            wixData.query('match')
            .gt('dateHeure', lowerDate)
            .lt('dateHeure', upperDate)
            .descending(tri)
            .limit(300)
            .find()
            .then( (res) => {
 let tableRows = res.items;
                $w('#table1').rows = tableRows;
            })
        }
 else {
            wixData.query('match')
            .gt('dateHeure', lowerDate)
            .lt('dateHeure', upperDate)
            .ascending(tri)
            .limit(300)
            .find()
            .then( (res) => {
 let tableRows = res.items;
                $w('#table1').rows = tableRows;
            })
        }
}

Is there a dropdown compatibility issue with IOS ? or anything else ?
Any idea ?

If it works everywhere else apart from on Safari on an Apple device, then I would say that the issue is to do with the Safari browser and you might possibly need to change your code slightly to allow for whatever is conflicting with the code and not letting it work correctly.

Can you try it on other browsers on an Apple device other than Safari to see if it is just limited to Safari and not other browsers on Apple devices?

If it is just Safari, then you can narrow it down completely to just an issue with that browser only.

If you are on the latest release of Safari, then it could be something simple like the Safari devs have altered something in the last update and this has affected the working of Wix code on Apple devices, hence why you are getting your issue.

Other browsers like Firefox and Chrome have a habit of being changed by their devs so that certain things don’t work after a new update!

Hopefully Wix Mods from this forum can pin down the issue for you and tell you how to alter your code for it to work properly in Safari.

Hi Givemeawhisky,
Just tried with Chrome under IOS, doesn’t work either (whereas Chrome/Windows is the one working at best). on IOS, it is a complete failure to react once the table is loaded.

In fact there is another issue, even on windows, even on Chrome : the onready property for dataset1 is frequently skipped upon reload of the page, resulting in the filtering being skipped too (as the filter/sort function is called from the onready event). Works something like once every 3 reloads. It worked quite well under Firefox Developer Edition, it doesn’t any longer (nor does it under Edge) ! In preview on Chrome, works always.
This unstable behaviour is really puzzling.