Update the paging functionality to determine if no data is left after delete.
The paging functionality will not change the page automatically if no data is left on the page.
I have recently encountered this issue, and I find it very astounding that i have found a request for this from several years ago and nothing has been done on it.
This shouldn't have to be done by end users, the goal of your functionality is to provide easier solutions to users. This should be automatic functionality of any code that creates a pager. If the fix is as simple as the replies to requests for this suggest, it should be very simple to implement this in your next build to function automatically if paging is active.
Please get this fixed.