Scrolling up when undo is pressed #2706

Closed
opened 2026-02-05 04:52:07 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @brurnt on GitHub (Mar 13, 2022).

Originally assigned to: @ssddanbrown on GitHub.

Describe the Bug

When you press Ctrl+Z text formated as code block disappears for an millisecond and reappears. That causes the page to scrolls as far up as the page without code blocks would look like.

Steps to Reproduce

  1. Write some text with code blocks between
  2. Press Ctrl+Z

Expected Behaviour

Text should not disappear/Site should not move

Screenshots or Additional Context

https://user-images.githubusercontent.com/85018786/158036572-11d82516-d532-42d0-a85f-d7eea64d7199.mp4

Browser Details

Firefox 98.0 (64-bit) on Windows 10

Exact BookStack Version

v22.02.3

PHP Version

No response

Hosting Environment

Docker-compose on Raspberry Pi 4B with Raspberry Pi OS Lite

Originally created by @brurnt on GitHub (Mar 13, 2022). Originally assigned to: @ssddanbrown on GitHub. ### Describe the Bug When you press Ctrl+Z text formated as code block disappears for an millisecond and reappears. That causes the page to scrolls as far up as the page without code blocks would look like. ### Steps to Reproduce 1. Write some text with code blocks between 2. Press Ctrl+Z ### Expected Behaviour Text should not disappear/Site should not move ### Screenshots or Additional Context https://user-images.githubusercontent.com/85018786/158036572-11d82516-d532-42d0-a85f-d7eea64d7199.mp4 ### Browser Details Firefox 98.0 (64-bit) on Windows 10 ### Exact BookStack Version v22.02.3 ### PHP Version _No response_ ### Hosting Environment Docker-compose on Raspberry Pi 4B with Raspberry Pi OS Lite
OVERLORD added the 🐛 Bug📝 WYSIWYG Editor labels 2026-02-05 04:52:07 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 25, 2022):

Thanks for raising @brurnt, I could confirm this behaviour.

This is a bit of a complex scenario, since code-blocks have to re-render upon certain actions such as undo/redo, but this takes a little time and hence can mess up the scroll positioning as the page content height changes during loading.

I've made some changes in d2b49084b0 which sets predicted sizes early to help address this. We can't be exact in the prediction, so it won't be 100% perfect, but from my testing this drastically helps negate the jumping effects and provides a much more stable experience.

These changes will be part of the next feature release so I'll therefore close this off.

@ssddanbrown commented on GitHub (Mar 25, 2022): Thanks for raising @brurnt, I could confirm this behaviour. This is a bit of a complex scenario, since code-blocks have to re-render upon certain actions such as undo/redo, but this takes a little time and hence can mess up the scroll positioning as the page content height changes during loading. I've made some changes in d2b49084b082f0aa28ca6969884b88acb2c63b96 which sets predicted sizes early to help address this. We can't be exact in the prediction, so it won't be 100% perfect, but from my testing this drastically helps negate the jumping effects and provides a much more stable experience. These changes will be part of the next feature release so I'll therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2706