CEF BrowserComponent (simulator) does not always update immediately after inserting images in text with Javascript.

17 views
Skip to first unread message

P5music

unread,
Aug 10, 2020, 2:28:07 PM8/10/20
to CodenameOne Discussions
I think this could be an issue for the CEF BrowserComponent so I report it.
My app has this BrowserComponent for text editing. There is some functionality that encompasses creating an image in text, at certain offset.
I can easily do that but the BC behaviour changes accordingly to the offset or sometimes in erratic fashion.
Here's what happens. When the offset is 0 or the last position the image does not appear just after inserting in the DOM as expected, instead I have to enter the editing field again to see it (and the size of the BC changes at this time, not before, so it is updated at this time and not before). 
This happens every time for those offset positions, but sometimes it happens in intermediate positions.
No matter whether I call focus() or other methods on the element (in Javascript), or other workarounds, the behaviour is solid, like it is an issue.
Thanks in advance

Shai Almog

unread,
Aug 10, 2020, 9:59:26 PM8/10/20
to CodenameOne Discussions
Odd. It might be a refresh problem. I'm assuming there's nothing obvious in the JavaScript console. Right?

P5music

unread,
Aug 11, 2020, 4:29:23 AM8/11/20
to CodenameOne Discussions
I do not see any message in the devtools console. But it is possible I am not using it correctly.
In the attached images you can see what's in Chrome. 
The depicted screen is the BrowserComponent. It does not resemble what I have on my layout, that is, a BC with text inside as usual. When inserting the image, regardless it is the case that it appears or not in the BC, a blue rectangle appears in the above mentioned screen, then if I click again on the BC the rectangle becomes gray, then next time it disappears.
Notice that when the image is correctly inserted in the DOM it is highlighted in blue first, then it becomes normal.
2020-08-11 10-22-06.png
2020-08-11 10-21-34.png
2020-08-11 10-20-36.png

Shai Almog

unread,
Aug 11, 2020, 9:56:04 PM8/11/20
to CodenameOne Discussions
Can you file an issue on this?
I'm not sure if we can fix this directly since we need a reproducible test case but I'm guessing other issues will include those. Once we fix those issues I'd like this to be in the tracker so we can verify this was fixed. If not we'll need to go over that.

P5music

unread,
Aug 12, 2020, 5:07:36 AM8/12/20
to CodenameOne Discussions
Reply all
Reply to author
Forward
0 new messages