singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.6k stars 840 forks source link

Fix: Block Attributes are not displayed if the editor is empty #2210

Closed CatHood0 closed 2 months ago

CatHood0 commented 2 months ago

Description

Block Attributes issue

Also fixed an issue with block attributes not being visible when the Document was empty. In addition to this, added the ability for the editor to display block attributes next to the placeholder (the attribute) so that the user can see how their text will look even if the entire Document is empty.

Before:

https://github.com/user-attachments/assets/3109fdf6-1445-4731-91bf-56715783e98e

After:

https://github.com/user-attachments/assets/47555b95-1c2c-4f1e-9acc-c6e45e38a1eb

Delta diff issue

Fixed some issues with trying to constantly select or move to a position that doesn't exist. This was because delta_diff previously didn't reliably check the difference between 2 Deltas. Now added some checks (not perfect) which avoid these issues.

How it works now:

https://github.com/user-attachments/assets/85ba9da7-bd2b-4cf2-9173-cf166d96819d

However, I'll keep an eye out for different scenarios that could cause delta_diff to fail (I'm not doing it in this PR as I'm already doing 2 PRs in one due to time constraints).

Related Issues

singerdmx commented 2 months ago

what are you waiting for?

CatHood0 commented 2 months ago

@singerdmx sorry, I've been busy. I uploaded the PR to then start showing the changes but things have not turned out as I expected. I'll start fixing some other things this PR does to finish these changes.

EchoEllet commented 2 months ago
As much as I appreciated the review request... As much as I appreciated the review request, I'm not quite familiar with those areas of the project, I need more time to take a look at it. Most of the PRs I send nowadays from time to time are simple and don't require much time. I might go back someday however it will unlikely anytime soon.