Phenomenon
When typing rapidly near the edges of a contenteditable element in Chrome, the frequent auto-scrolling causes performance issues. The page becomes laggy and typing feels unresponsive.
Reproduction example
- Create a contenteditable element with scrollable content
- Type text rapidly near the bottom edge
- Observe performance
Observed behavior
- Page becomes laggy
- Typing feels unresponsive
- Scroll operations are expensive
- Performance degrades significantly
Expected behavior
- Scrolling should be smooth and performant
- Typing should remain responsive
- Performance should not degrade
- Scroll should be optimized
Browser Comparison
- Chrome/Edge: May have performance issues (this case)
- Firefox: Similar performance problems
- Safari: Performance varies
Notes and possible direction for workarounds
- Throttle scroll operations
- Use
requestAnimationFramefor smooth scrolling - Debounce scroll calculations
- Optimize scroll performance