Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make MonacoEditor scroll with parent container when mouse hovers&scrolls #28479

Open
JVimes opened this issue Dec 15, 2023 · 3 comments
Open
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@JVimes
Copy link

JVimes commented Dec 15, 2023

Description

When editing a file with the mouse cursor over the editor, the mouse wheel only affects the editor and not the web page. I'd expect it to affect the web page once the editor is scrolled to its top/bottom.

  1. Click pencil icon on a text/markdown file
  2. Place the mouse cursor over the document
  3. Try to scroll to the bottom of the webpage using the mouse wheel

Actual: It only scrolls the document pane.
Expected: Once document is scrolled to its bottom, the web page scrolls.

Gitea Version

1.21.1

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

It happens on https://try.gitea.io/

Database

None

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Dec 15, 2023

That's how MonacoEditor works, you can try it here: https://microsoft.github.io/monaco-editor/ , unless you can figure out a config option to control the scrolling behavior.

@wxiaoguang wxiaoguang added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug labels Dec 15, 2023
@JVimes
Copy link
Author

JVimes commented Dec 15, 2023

Looks like the flag is editor.scrollbar.alwaysConsumeMouseWheel: false.

@wxiaoguang wxiaoguang added type/proposal The new feature has not been accepted yet but needs to be discussed first. and removed issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail labels Dec 15, 2023
@wxiaoguang wxiaoguang changed the title Can't scroll page with cursor over file editor Make MonacoEditor scroll with parent container when mouse hovers&scrolls Dec 15, 2023
@silverwind
Copy link
Member

silverwind commented Dec 15, 2023

Makes sense to "bubble" this scroll, especially because we already set scrollBeyondLastLine: false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

3 participants