### Apache Airflow version

Other Airflow 2 version (please specify below)

### What happened

Hi, I'm currently on Airflow 2.4.2
In /home when sorting by DAG/Owner/Next Run and going to the next page the sort resets.
This feature only works if  I'm looking for last or first, everything in the middle is unreachable.

### What you think should happen instead

The sorting should continue over the pagination

### How to reproduce

Sort by any sortable field on DagList and go to the next page

### Operating System

apache/airflow:2.4.2-python3.10

### Versions of Apache Airflow Providers

_No response_

### Deployment

Official Apache Airflow Helm Chart

### Deployment details

_No response_

### Anything else

_No response_

### Are you willing to submit PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

assert "search=%27%3E%22%2F%3E%3Cimg+src%3Dx+onerror%3Dalert%281%29%3E" == utils.get_params(
            search="'>\"/><img src=x onerror=alert(1)>"
        )
    def test_state_token(self):
        
        
        html = str(utils.state_token("<script>alert(1)</script>"))
        assert "&lt;script&gt;alert(1)&lt;/script&gt;" in html
        assert "<script>alert(1)</script>" not in html
    def test_task_instance_link(self):
        from airflow.www.app import cached_app
        with cached_app(testing=True).test_request_context():
            html = str(
                utils.task_instance_link(
                    {"dag_id": "<a&1>", "task_id": "<b2>", "execution_date": datetime.now()}
                )
            )
        assert "%3Ca%261%3E" in html
        assert "%3Cb2%3E" in html
        assert "<a&1>" not in html
        assert "<b2>" not in html
    def test_dag_link(self):
        from airflow.www.app import cached_app
        with cached_app(testing=True).test_request_context():
            html = str(utils.dag_link({"dag_id": "<a&1>", "execution_date": datetime.now()}))
        assert "%3Ca%261%3E" in html
        assert "<a&1>" not in html
    def test_dag_link_when_dag_is_none(self):