Legacy table - default selected page

I have a paginated (not server-side) legacy table populated by a MySQL query that runs on page load or if triggered by several search boxes (text-input fields). Recently, when the query runs, the table is defaulting to page 10, regardless of whether there are 10 pages of data or not, often making the table appear empty unless the end-user notices it's on the wrong page.

I've added event handlers to the search boxes to try to force the table to default to page 1 when the query is run via one of these fields, which mostly works, although if the same search box is changed twice in a row, often on the second change, page 2 of the table is selected instead of page 1, but I'd like to stop this behaviour altogether and just have the table default to page 1 unless a row is selected.

This has been going on at least since I updated our on-premises version to 3.8.4, though it may have also been happening previously and just not been reported by the end-users.

Any idea what's causing this and how to prevent it from happening?