I contribute to a text editor app and have observed the following behavior: When I add or remove a MetricAffectingSpan
(have tested with LineHeightSpan
and TextAppearanceSpan
), the edit text jumps to the current cursor location.
The jump appears to be triggered by a call to bringPointIntoView()
in onPreDraw()
. Adding CharacterStyle
spans such as ForegroundColorSpan
or BackgroundColorSpan
does not cause this behavior.
This behavior is undesirable. I would like to prevent the addition of spans from causing the scroll position to jump. An explanation of what is going on and possible ways to work around it would be very helpful.