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

Shifting scroll highlight when scrolling beyond bounds of code editor #51

Open
mack-at-pieces opened this issue Jun 27, 2022 · 3 comments

Comments

@mack-at-pieces
Copy link
Contributor

I'm currently using the CodeEditor for MacOS and experiencing an issue where the scroll highlight shakes and shifts when dragging past the bounds of the CodeEditor.

I'm unsure where this issue lies, whether it be something wrong with my code or the editor itself, but perhaps @BertrandBev or @alexeyinkin you may be able to shed some light here.

@alexeyinkin I noticed you do not experience this problem in your project here (https://play.beam.apache.org/), so perhaps there's something I can do to also resolve this.

Video attached.

Pieces.Text.Highlight.Drag.Shift.mov
@alexeyinkin
Copy link
Collaborator

alexeyinkin commented Jun 27, 2022

I don't have a Mac to verify this. I only develop for web and test regression on Android. Looks like you are building a native Mac app, so everything is completely different there.

I suggest you try to run the official example and see if it happens there. It is kind of bare boned.
If it reproduces there, try ordinary TextField with ordinary TextEditingController. If it reproduces there as well, look if this is reported in Flutter issues and file a new one if it is not.

If bare TextField works alright but CodeField does not, then it is possible to strip this package's code method-by-method until bare TextField and TextEditingController are left and to pinpoint the problem.

Unfortunately, I am not the one to do this as we stick to our project scope.

@mack-at-pieces
Copy link
Contributor Author

@alexeyinkin Thanks for the response. I figured I'd check before diving in that deep. Will be exploring this further over the coming days.

@mack-at-pieces
Copy link
Contributor Author

@alexeyinkin @BertrandBev Found that this is caused by a conflict between the built-in TextField scroll and a SingleChildScrollView wrapping the CodeEditor.

It is in fact reproduced in the example app. I was able to get around this by setting expanded: true on the CodeField and removing the SingleChildScrollView.

This is not a problem with the Flutter TextField given that a bare widget with maxLines: null and a constrained container do not show this issue.

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

No branches or pull requests

2 participants