superlistapp / super_editor

A Flutter toolkit for building document editors and readers
https://superlist.com/SuperEditor/
MIT License
1.67k stars 245 forks source link

[SuperEditor] iOS magnifier flashes, poor visibility, creates additional selection, and toggles toolbar #1550

Closed Jethro87 closed 12 months ago

Jethro87 commented 12 months ago

This is on the latest stable super_editor stable (https://github.com/superlistapp/super_editor/pull/1546).

https://github.com/superlistapp/super_editor/assets/6467808/fb18cb89-181b-4d63-81da-e5bc72091755

Jethro87 commented 12 months ago

cc @matthew-carroll

matthew-carroll commented 12 months ago

@angelosilvestre can you remind me what the problems were with the magnifier that caused blinking? I remember that a magnification of 1x was one problem, but looking at Jeff's video, it looks like his blinking magnifier has a higher magnification. Was there also something related to shadows?

angelosilvestre commented 12 months ago

@matthew-carroll In my tests, when there was a widget with shadows the issue didn't happen.

matthew-carroll commented 12 months ago

@angelosilvestre can you elaborate? What should @Jethro87 try to root cause the issue? I don't see any flashing the Super Editor demo, so we need to expand the analysis.

angelosilvestre commented 12 months ago

@matthew-carroll As the previous issue was solved by adjusting the magnification I didn't dig deeper to figure out an explanation to this. But what was happening is that, when placing any widget with shadows in the widget tree, like a FAB or a Material, the blinking stopped. This isn't a solution, it's just some additional information...

It might be related to the RenderBox pushing a layer for the shadows, but it will require more investigation.

matthew-carroll commented 12 months ago

@Jethro87 do you know if you have any widgets with a shadow in your widget tree?

Jethro87 commented 12 months ago

@matthew-carroll The video above was taken in the super_editor example app. I've just tested it again and noticed that the flashing only occurs in the sliver editor example. Both of the following examples are running super_editor stable + Flutter stable (3.13.8) on an iPhone 12.

Standard editor

https://github.com/superlistapp/super_editor/assets/6467808/4c5f2793-cda9-4f40-baa8-c1ff7e237480

Sliver editor

https://github.com/superlistapp/super_editor/assets/6467808/645db68c-7e87-4d37-8273-a6643fcccb69

matthew-carroll commented 12 months ago

@Jethro87 can you try the PR that I posted? I tagged you in it.

matthew-carroll commented 12 months ago

Also @Jethro87 if the flashing still happens in the PR where I tagged you, can you try on Flutter master with our main branch? Maybe Flutter fixed a bug...

matthew-carroll commented 12 months ago

@Jethro87 Here's what I found with the Sliver example:

SuperEditor main, Flutter master -> no problem

SuperEditor stable, Flutter master -> no problem

SuperEditor stable, Flutter stable -> magnifier flashing and unexpected showing and hiding of overlay controls

This sure seems like a Flutter bug (or two). Please confirm on your end, too.

If it's a Flutter bug, you can file an issue with Flutter, asking them to cherry pick a fix over to stable, or you can wait for the next stable version.

matthew-carroll commented 12 months ago

@Jethro87 I merged the associated PR, which closed this issue. If aspects of this issue ticket still remain, and they aren't Flutter bugs, please let me know, and we can re-open this ticket.

Jethro87 commented 12 months ago

@matthew-carroll Thanks for digging in. The flickering issue is also not present when using Flutter beta.