-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Avoid scrolling to cursor when tap on a checkbox #400
base: master
Are you sure you want to change the base?
Conversation
f905971
to
bd834ea
Compare
@kfdykme do you know the root cause of the scroll jump? |
@amantoux the root cause is that whenever the editor content changes, the editor scrolls to the cursor position. I think this is ok. But sometimes I don't need this functionality, I just want to change the checkbox state without doing any editing. steps:
4,5,6 are one module, 1,2,3 are another module, they are running correctly according to their roles. When they run together, it feels weird. Another solution is to select the row of the checkbox when the checkbox is clicked? |
|
It won't request the keyboard, but it will scroll to the cursor using _showCaretOnScreen : When you tap on a checkbox, the cursor won't change because the selection doesn't change by simply tapping the checkbox. As a result, it may scroll to a strange position. Here are two possible solutions that might be useful: Provide an option to skip scrolling when tapping on a checkbox. This allows users to choose whether they want the scrolling behavior or not. Change the selection position before scrolling to ensure that it aligns with the checkbox value change. This ensures that the cursor is in the correct position before any scrolling occurs. |
@kfdykme I agree with the two possible solutions. The conclusion is that I think it is |
@kfdykme Sorry for not being clear. I meant that it's "like" the other issue where it also affected the collaborative editing experience and this issue reminded me of that. Not that they are the same issue. Although, I'm not in favor of having this workaround in the Fleather. The checkbox right now is the only interactive widget in Fleather, but it might change in future. Also it does not fix the issue with remote changes. @amantoux |
@kfdykme while we decide on the best approach |
@Amir-P your previous statement acknowledges the fact that there is a general need to support changes without affecting the scroll position so I'm a little confused Can you be more specific? |
@amantoux Let me recap my points:
|
If a user is editing, do they also need to cancel the focus? |
Can I assume that this issue concerns the checkbox or other future prepended widgets, but should remain self-consistent inside the widget, rather than being a global option controlled by the controller. Therefore, I can fix it directly at the checkbox level, rather than modifying the controller. |
What I mean is that when the user clicks on the checkbox, maybe we should remove focus from editor prior to updating parchment via the controller to avoid the scroll jump-to, I didn't check if this was feasible but it could be a desired behavior. |
Hi, I don't know if this is a bug or a feature. But every time I open FleatherEditor, scroll to the bottom, and just want to change the checkbox, it scrolls to the top. I feel bad, so is it possible to make it optional?
Please give me some advice? I'll add a test if I can.
Fleather.-.rich-text.editor.for.Flutter.-.1.-.Microsoft.Edge.2024-08-12.00-42-36.mp4