Accessibility
- It is a real button named by
label("Back to top" by default), with the same text as its tooltip. - It is only in the page while it is shown, so it is never an invisible tab stop on the first screen.
- Used from the keyboard, focus returns to the first focusable element on the page, so the next Tab continues from the top rather than from a button that has just disappeared. A mouse click leaves focus where it is.
- Under reduced motion the page jumps instead of scrolling smoothly, and the button appears without a transition.