simpleclub / math_keyboard

Math expression editing using an on-screen software keyboard or physical keyboard input in a typeset input field in Flutter.
https://simpleclub.github.io/math_keyboard
BSD 3-Clause "New" or "Revised" License
134 stars 50 forks source link

Autoscroll math field back to starting position #23

Open GoTrust-BaoNH opened 3 years ago

GoTrust-BaoNH commented 3 years ago

Bug description

I can't goBack() cursor back to starting position

To Reproduce

Steps to reproduce the behavior:

  1. I input full text of MathField

image

  1. I input some characters to hide some of characters at start position

image

  1. Then, I use PreviousButton that move cursor to start position

image

  1. But I can't move cursor to start position

image

github-actions[bot] commented 3 years ago

Hi 👋🏽 Thank you for opening your first issue with simpleclub/math_keyboard ❤

You can expect triage from us soon 🙂 In the meantime, you can try to search for similar issues in our issue database.

creativecreatorormaybenot commented 3 years ago

Hi @GoTrust-BaoNH, thanks for using the package and opening the issue!

This is right now a known limitation, where we do not yet calculate if the cursor reaches the start of the visible area.
The idea right now is that you scroll manually. Can you try to scroll the math field manually (swipe with finger or with trackpad)? And do you think that works for you?

GoTrust-BaoNH commented 3 years ago

Hi @GoTrust-BaoNH, thanks for using the package and opening the issue!

This is right now a known limitation, where we do not yet calculate if the cursor reaches the start of the visible area. The idea right now is that you scroll manually. Can you try to scroll the math field manually (swipe with finger or with trackpad)? And do you think that works for you?

It works with scroll the math field manually. But I want use PreviousButton. Can you suggest me a way to fix it?

creativecreatorormaybenot commented 3 years ago

@GoTrust-BaoNH I think the only way to achieve it is by contributing here.

The way it would work is finding the render box that draws the cursor and ensuring that is visible in the scroll view using: RenderObject.showOnScreen

I think to handle it nicely, we need to adjust flutter_math, but it should be possible to do it without that.