-
Notifications
You must be signed in to change notification settings - Fork 836
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
Unable to Delete Heading 1 at the Beginning of a Line with Backspace #2180
Comments
Sorry but we seem to have had a collision over this issue. I just submitted a PR that simply resolves this problem with minimal changes to raw_editor_actions (line101) consistent with the method used for inline styles. Unfortunately, your changes block my changes, so we need to resolve the differences. If I comment out your call to Can you look into this and see how we can handle the conflict? |
I have confirmed the operation. By commenting out _handleBackspaceKey, your changes work perfectly. It also functions correctly for deleting inline elements, and I particularly like the behavior where text inside a block is not deleted if it remains. I will submit a pull request to revert this pull request. Thank you. |
Thank you for your kind words. |
This improvement only works on the desktop version. On iPhone, even though the toolbar reverts to the normal style when pressing backspace, the header style is not removed. Upon investigation, it seems that the QuillEditorDeleteTextAction is not triggered on mobile devices. Do you have any idea what might be causing this? |
Interesting: Running an android emulator, when I use the computer's keyboard, everything works correctly. However, when I use the emulator's keyboard it fails. There must be something peculiar about the keyboard handler. Another anomaly is: select header1 and enter text. Remove the text using BS on the emulator's keyboard. As soon as the last character is removed, the toolbar loses the header state. This state should be retained and only removed when you press BS one more time. Because this attribute is lost too soon, the code to process the extra BS does not call formatText and QuillEditorDeleteTextAction. This is probably the reason for the failure. Strangely no other block attribute has this effect. Alignments and lists all work correctly, but font settings (headers, fonts, and line height) all fail. That makes no sense. I'm tied up with other things at the moment but will try to take another look and dig deeper to see if I can figure out what is happening here. |
This issue might be related. |
The following issue might also be related. It seems that in Flutter, there is no way to handle the delete key event on mobile keyboards. |
Those posts are very disappointing. How can Flutter be taken seriously when such errors exist? At present, I am stuck. I had to reinstall Android Studio to fix an unrelated problem. Now, there is an incompatibility between gradle and java because of the latest Android Studio (Ladybug) release which is causing everyone problems! What this all means is I cannot even build for Android let alone try to figure out what is going on with this issue. It will probably be faster if you look into this. The key observations are:
Other inline and block attributes work correctly with the backspace on the soft keyboard. |
Fixed the issue in #2312 for the example app. Also, see this comment. |
Is there an existing issue for this?
Flutter Quill version
10.5.5
Steps to reproduce
Expected results
The Heading 1 style should be removed, and the text should revert to normal formatting.
Actual results
The Heading 1 style is not removed and remains applied. Although the toolbar shows that the text has reverted to normal, the Heading 1 style is still applied, and any new text entered continues to be formatted with Heading 1.
Code sample
Code sample
[Paste your code here]
Additional Context
This issue has been confirmed on macOS, iOS, and Android.
Screenshots / Video demonstration
default.mp4
Logs
[Paste your logs here]
The text was updated successfully, but these errors were encountered: