[Bug Report]: Weird behaviour while editing a page if template sidebar is closed #2590

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

Originally created by @quaintdev on GitHub (Jan 21, 2022).

Originally assigned to: @ssddanbrown on GitHub.

Describe the Bug

While using markdown editor the cursor if suppose is on line 9 and we are trying to do backspace it ends up editing line 8. This happens when I close the template sidebar.

Steps to Reproduce

  1. Create new page
  2. Choose template
  3. Start editing text
  4. Close the sidebar
  5. And now cursor is at one line but ends up editing other line (this especially happens if you are trying to navigate using arrow keys, backspace, delete.)

Expected Behaviour

The cursor should not change position when the template sidebar is closed and should only edit the line or text that it is on.

Screenshots or Additional Context

No response

Exact BookStack Version

v21.12.1

PHP Version

No response

Hosting Environment

Hosting on raspberry pi 2 using docker.

Originally created by @quaintdev on GitHub (Jan 21, 2022). Originally assigned to: @ssddanbrown on GitHub. ### Describe the Bug While using markdown editor the cursor if suppose is on line 9 and we are trying to do backspace it ends up editing line 8. This happens when I close the template sidebar. ### Steps to Reproduce 1. Create new page 2. Choose template 3. Start editing text 4. Close the sidebar 5. And now cursor is at one line but ends up editing other line (this especially happens if you are trying to navigate using arrow keys, backspace, delete.) ### Expected Behaviour The cursor should not change position when the template sidebar is closed and should only edit the line or text that it is on. ### Screenshots or Additional Context _No response_ ### Exact BookStack Version v21.12.1 ### PHP Version _No response_ ### Hosting Environment Hosting on raspberry pi 2 using docker.
OVERLORD added the 🐛 Bug💻 Front-End labels 2026-02-05 04:34:44 +03:00
Author
Owner

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

Thanks for reporting @quaintdev, I could confirm this.
From my testing, I don't think this was specifically due to the template system, but could occur whenever the markdown editor box resized (Likely due to sidebar expand/collapse) while having content that may span over a single line. The editor would use old line positioning for the cursor then correct itself after typing.

I have patched this in aaa2205df1, so that the editor layout is refreshed after resize.
This will be part of the next patch release.

@ssddanbrown commented on GitHub (Jan 25, 2022): Thanks for reporting @quaintdev, I could confirm this. From my testing, I don't think this was specifically due to the template system, but could occur whenever the markdown editor box resized (Likely due to sidebar expand/collapse) while having content that may span over a single line. The editor would use old line positioning for the cursor then correct itself after typing. I have patched this in aaa2205df1055a02243c1fe3c191dbe411e8290a, so that the editor layout is refreshed after resize. This will be part of the next patch release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2590