Looks fine, however, you might consider another behavior for the '-2' case.
Adding a plus or minus sign before an integer could also be used to navigate n pages forwards or backwards. Granted, this function will only be used by a few users, so it's up to you to decide whether you want to implement this.
Accessibility concerned, I think you'll be just fine if you remove unwanted characters after your input element has lost focus.
Have you already thought of the worst case scenario? The user inputs a string that can't be converted to a sensible page number. What will happen then?