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

Add option to control scroll chaining #5632

Closed
2 tasks
Chocobo1 opened this issue Aug 22, 2024 · 3 comments
Closed
2 tasks

Add option to control scroll chaining #5632

Chocobo1 opened this issue Aug 22, 2024 · 3 comments

Comments

@Chocobo1
Copy link

Describe the feature

With scroll chaining, when scrolling and scroll boundary is reached the underlying page will then start to scroll.
I would like an option to enable/disable the scroll chaining of the ace editor, or some way to apply it on the ace editor element. I already tried to apply overscroll-behavior: contain to ace editor but it has no effect.

MDN explains it better than me: https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior#description
And also see the examples: https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior#examples

Use Case

For example, on the right side http://turingmachine.io/ there is an element to enter some code. When the code has many lines, the vertical scrollbar will appear and the user will want to scroll. However, when the user scrolled down to the boundary and didn't stop quickly enough, the parent page starts to scroll and gives bad user experience (because user did not expect the parent page to scroll).

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

ACE version used

1.35

@nightwing
Copy link
Member

Currently you can use editor.container.addEventListener("wheel", function (e) { e.preventDefault()})

@Chocobo1
Copy link
Author

Currently you can use editor.container.addEventListener("wheel", function (e) { e.preventDefault()})

Thanks, that worked!

Anyway, I leave the fate of this ticket to your discretion.

@InspiredGuy
Copy link
Contributor

InspiredGuy commented Aug 26, 2024

Since there is a way to prevent scroll chaining with current implementation, I will close this issue. If there will be a demand for an option instead of adding event listener this issue can be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants