UI Scroll Position Jumps When Pasting into Long Code Blocks

What’s The Bug?

Pasting text into a long code block causes the UI to unexpectedly scroll back to the top of the code block, disrupting the editing flow.

How To Reproduce It

  1. Create a code block with 100+ lines of content (e.g., placeholder text).
  2. Scroll to the middle of the code block.
  3. Paste new text (e.g., 5-10 lines) using ⌘V.
  4. Observe the scroll position.

Image or Video

The Expected Behavior

The scroll position should stay at the current editing point when pasting new content.

Additional Context

Happens consistently with large code blocks. Does NOT occur when editing short blocks (<20 lines).

Device

MacBook Pro 2021

OS

macOS Sequoia 15.4

Anytype Version

v0.46.1

Network Mode

Local-only

Technical Information

OS version: darwin arm64 15.4.0
App version: 0.46.1
Build number: build on 2025-04-17 20:22:50 +0000 UTC at #de38863027eb064b5b0ec258ce088fc45cb213cb
Library version: v0.40.16
Anytype Identity: A76uznCnqpt7PBHg3n1DducsCST9qGPLBKjsQRiBkfeVi2U3
Analytics ID: 09f872dc-6cfa-4d22-836f-dca1b9846f1e
Device ID: 12D3KooWFsocCLyNSdJfq9q43jV2zuKGJ1y6iGGygRKgpUecGSjb
Ethereum Address: 0xE715d09c84D089a91bf3D181ccf790c05590eA36

This is a very annoying problem, which seriously affects the desire to use Anytype code blocks.

This report has been added to our issue tracker and received by the Development Team.

What’s The Bug?

Pasting clipboard content into a code-box causes a jump to the top of the Page.

  • It does NOT happen if you paste the content in the upper part of the code-box.
  • But it happens if you have scrolled deeper in the code-box and paste the content there.

How To Reproduce It

  1. Put a code-box on the canvas.
  2. Fill the box with so much code-lines that you need to scroll.
  3. Scroll down in the box and paste there some code-lines from the clipboard.

Image or Video

The Expected Behavior

Pasting shouldn’t cause a jump.

Additional Context

Device

Desktop PC

OS

Win 10

Anytype Version

0.47.5

Network Mode

AnySync

Technical Information

OS version: win32 x64 10.0.19045
App version: 0.47.5
Build number: build on 2025-06-27 13:25:58 +0000 UTC at #fcd0f274451d6fd888761f5a67e2aabfb4978335
Library version: v0.41.2
Anytype Identity: AAtt6aReARByswg2CbvZhveoJEEcnydfDu7U2VAkgJALsE7D
Analytics ID: 8a514008-4f5d-40d3-970f-a0d241b63af2
Device ID: 12D3KooWAo1ZjisD5i5xjpokEMeH1UCdbtYbRLJ4pWuTkHMFa8Qc
Ethereum Address: 0x2da4881c5D6689bac7d6B6BC00D8862aACca9B60

Is this a duplicate of: UI Scroll Position Jumps When Pasting into Long Code Blocks?

Yes, it’s exactly the same bug.
– Sorry for the dup!

What’s The Bug?

I have to constantly scroll down to view my pasted content, which disrupts my workflow when pasting multiple items on the same page. Each time I paste, the position jumps upward, making it difficult to keep track of my work.

How To Reproduce It

  1. Open the page where you want to paste content.
  2. Scroll down to the desired location.
  3. Copy some text from another source.
  4. Place your cursor at the desired spot in the document.
  5. Press CTRL+V to paste the copied content.
  6. Notice that after pasting, the view automatically jumps upward, away from the pasted content.
  7. Scroll down again to find and view your pasted content.
  8. Repeat steps 3–7 to observe the issue when pasting multiple times.

The Expected Behavior

When pasting content using CTRL+V, the cursor and viewport should remain at or near the insertion point. The page should not jump upward unexpectedly, allowing the user to immediately see and continue working with the newly pasted content without having to scroll manually. This ensures a smooth and uninterrupted workflow when pasting multiple pieces of content on the same page.

Additional Context

Device

OS

Archlinux

Anytype Version

0.47.5

Network Mode

Selfhosted

Technical Information

Upon request.

Is this a duplicate of UI Scroll Position Jumps When Pasting into Long Code Blocks?

Indeed yes, it also does this when doing CTRL Z/ Undo. So you probably can merge this bug report with the original.

I use AnyType on Linux (Ubuntu 22.04) and have the same issue. I paste code snippets a lot, and this really bothers me. I’ve been using AnyType for about 2 years and have experienced this issue since day one.

What’s The Bug?

In larger code snippets that don’t fit on the screen, certain actions cause the note to scroll up unexpectedly. For example, when I’m at the end of the snippet and undo the last action (Ctrl+Z), the page scrolls up for no apparent reason, forcing me to manually scroll back down to continue editing. This becomes quite frustrating when doing it frequently.

How To Reproduce It

  1. Create or open a note and add a code block (snippet) that is large enough to not fit entirely on the screen (e.g., fill it with multiple lines of code until scrolling is required).
  2. Scroll to the bottom of the code snippet so the cursor is at the end.
  3. Perform an action, such as typing some text.
  4. Undo the last action using Ctrl+Z (or the equivalent undo shortcut).
  5. The note/page scrolls up unexpectedly, moving the view away from the cursor position at the bottom.

The Expected Behavior

After undoing an action at the end of a large code snippet, the view should remain at the cursor position without scrolling up. The user should not need to manually adjust the scroll to resume editing.

Device

PC

OS

Windows 11

Anytype Version

v0.50.5

Network Mode

AnySync

Technical Information

OS version: Windows 11 Pro (10.0.26100)
Motherboard: MSI PRO B760M-A WIFI DDR4
CPU: Intel Core i5-12400F
GPU: NVIDIA GeForce GTX 1650
Display resolution: 1920x1080@74hz
RAM: 32 GB DDR4
Anytype version: 0.50.5
Anytype ID: A6sG6gQrxLkNocMuEFYvRhnGvt7AaghVCvijvzJhWx7TFmz9

This issue has been fixed by the Development Team and will be implemented in an upcoming release.

There are still some issues regarding this bug. I am on the latest 0.54.11.