mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 17:52:45 +08:00

Prior to this fix using: - `replaceText(...)` - `selectText(..., ..., { scroll: true})` Wouldn't have the expected behaviour as the scroll from selectText will attempt to save the scroll position and restore it AFTER the replacement happened. This commit allows scroll to be a Boolean or a Number, when a number, it will be used to restore the scrollTop position. I tried to write tests for this specific behavior but couldn't reproduce the issue in tests.