Phenomenon
When typing rapidly near the edges of a contenteditable element in Firefox, the automatic scrolling to keep the cursor visible is abrupt and jarring. The scroll happens suddenly rather than smoothly.
Reproduction example
- Create a contenteditable element with scrollable content
- Type text rapidly near the bottom edge
- Observe scroll behavior
Observed behavior
- Scroll happens abruptly without smooth animation
- Multiple scroll jumps may occur during rapid typing
- User experience is jarring
- Scroll position may jump unexpectedly
Expected behavior
- Scroll should be smooth and gradual
- Scroll should happen predictably
- User experience should be pleasant
- Scroll should keep cursor visible without jarring
Browser Comparison
- Chrome/Edge: Generally smoother scrolling
- Firefox: More abrupt scrolling (this case)
- Safari: Scroll behavior varies
Notes and possible direction for workarounds
- Implement custom smooth scrolling
- Use
scrollIntoViewwith smooth behavior - Throttle scroll operations during rapid typing
- Use
requestAnimationFramefor smooth scrolling