"PASTE" option appears when closing menu and touching editable text in CEF BrowserComponent / focus gained just after menu is opened

15 views
Skip to first unread message

P5music

unread,
Feb 5, 2021, 8:49:44 AM2/5/21
to CodenameOne Discussions
I would like to inform you about what happens with CodenameApp on Android devices
(I do not know about iOS at present time)

When you open the menu
and then you close it with a gesture from left to right

the menu disappears: OK
but
also it can happen that 
    if you touch a BrowserComponent in text editing (editable element)
   
the PASTE option appears: NOT OK.

It seems not to be affecting TextField/TextArea components: OK
but
also it seems that the BrowserComponent gains the focus when opening the menu: NOT OK.
Regards

Shai Almog

unread,
Feb 6, 2021, 12:58:25 AM2/6/21
to CodenameOne Discussions
This is one of the nuances of the z-ordering with components. Please file an issue with a test case, we'll try to resolve it.
It might be a bit difficult as it might require a special case for this.

I would suggest disabling the swipe gesture of the menu when using native widgets.

P5music

unread,
Feb 6, 2021, 5:43:46 AM2/6/21
to CodenameOne Discussions
But why does the focus go to the native component, i.e. the BrowserComponent, when the menu is opened?

Shai Almog

unread,
Feb 6, 2021, 9:11:26 PM2/6/21
to CodenameOne Discussions
It doesn't "know" about the menu. When a touch event occurs we're in the native thread and need to decide whether it goes to.a peer or a lightweight.
So we loook through the component hierarchy to see if it's one or the other. There's no lightweight in the hierarchy at that stage so the browser component grabs the event and the lightweight menu doesn't get it.
The solution is a special case for the side menu swipe in the native OS ports. That's pretty hard to do so I'm not sure when we'll get around to do it.
Reply all
Reply to author
Forward
0 new messages