[web] All inserted widgets in editor (e.g. image) has been rebuilding constantly #178
Replies: 12 comments 4 replies
-
@rish07 do you know anything about it? |
Beta Was this translation helpful? Give feedback.
-
Fixed by 54c3eb4 Please reopen if it still exists |
Beta Was this translation helpful? Give feedback.
-
@singerdmx I would like to reopen this issue, because it is still visible in 1.0.9 version. The video shows the blinking image when I am adding new line.. blinking.image.mp4 |
Beta Was this translation helpful? Give feedback.
-
Hey @singerdmx, i am busy with my exams rn, will take a look after them. |
Beta Was this translation helpful? Give feedback.
-
hello @rish07 PS. I think it might be not only relevant to Web, but this is only my suspicious. |
Beta Was this translation helpful? Give feedback.
-
I can make an update to this, as I have tried analyze it deeper. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Any update on this issue yet? |
Beta Was this translation helpful? Give feedback.
-
Today, I experimented quite a bit with the QuillEditorWebImageEmbedBuilder. It works well for the most part, and the "flickering" doesn't occur. However, the challenge that arises is that you can only specify a fixed BoxConstraint for all images in the document. Having two images of different sizes disrupts the layout. I tried to make the BoxConstraints adjustable during the building process, depending on which image is currently being built. However, this led back to the "flickering" issue because it took some time to extract the height and width of the image via HTML. If anyone finds a way to scale the BoxConstraints of the QuillEditorWebImageEmbedBuilder variably according to the image size, this problem would also be solved on the web. Maybe something like this:
....
In my case, it didn't work because imageSize.height and imageSize.width were null. |
Beta Was this translation helpful? Give feedback.
-
I have now solved it for my use case. I adapted the QuillEditorWebImageEmbedBuilder in flutter_quill_extensions so that the height and width of every image from the base64 string are extracted and given to the image as constraints when it is built.
And in my flutter project it looks like this:
|
Beta Was this translation helpful? Give feedback.
-
I had a problem with a custom memory image widget flickering every time I type or move the cursor. As other people mentioned here every widget is rebuilt whenever you interact with the editor (which is not inherently a bad thing). My problem was that I was creating the I solved this by implementing a simple caching mechanism that ensures the same Leaving this here as it might help other people in the future, let me know if this is the inappropriate place 😄 |
Beta Was this translation helpful? Give feedback.
-
Hello,
I would like to ask about whether it is a editor nature (and its internal limitation) or could be improved.
When I am entering new line by clicking enter (or pasting new image or other action) the inserted image (and every custom widget which I have inserted) is being rebuilt every time when such action appears.
It looks like every action which I mentioned (new line etc.) causes that the whole editor executes embedBuilder and create new instances of inserted widgets (i.e. image).
Do you see any chance which could improve this situation?
Beta Was this translation helpful? Give feedback.
All reactions