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

All font settings and styles are lost when you press Enter twice #1951

Open
1 task done
geronimol opened this issue Jun 26, 2024 · 2 comments
Open
1 task done

All font settings and styles are lost when you press Enter twice #1951

geronimol opened this issue Jun 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@geronimol
Copy link
Contributor

Is there an existing issue for this?

Flutter Quill version

9.4.5

Steps to reproduce

I think this issue is related to #1119

The styles seem to be kept when pressing enter one time, but they lost if you press twice.

Expected results

Keep styles after pressing Enter twice

Actual results

Styles are lost pressing Enter twice

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

Captura de pantalla 2024-06-26 a la(s) 16 01 35

Logs

Logs
[Paste your logs here]
@geronimol geronimol added the bug Something isn't working label Jun 26, 2024
@AtlasAutocode
Copy link
Collaborator

I've looked into this issue and the problem appears to be that styles are associated with characters (content).
Empty lines do not have characters and therefore do not have styles.
When you create a new line (pressing Enter key) the style has to be 'got' from somewhere.

I have been able to update the code to get the style by looking-back past empty lines (but there may be a better way of doing this). This solves your double-enter problem BUT I am concerned that it might introduce undesirable side effects for other users and need more time to explore consequences before submitting a PR.

Please let me know if you have found other 'unexpected' style effects so we can look into them as well.

@geronimol
Copy link
Contributor Author

@AtlasAutocode Thanks. I think this is an important issue since it is common behavior in text editors. Will wait for a fix.

This is another "issue" related to styles: #1925 . Not sure if there is another way to change the default style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants