CodenameOne icon indicating copy to clipboard operation
CodenameOne copied to clipboard

Edit field disappears when selectedon IOS in landscape mode.

Open ddyer0 opened this issue 4 years ago • 6 comments

For reasons I don't fully understand, I haven't been able to produce this in a simple environment, but on my app, on IOS, in Landscape mode, when an pop-up text entry is selected to start entering the text, it pops back down immediately.

The code that produces the pop-up is

        TextArea text = new TextArea(message);
	text.setSingleLineTextArea(true);		// used as a flag to cause the textarea to activate on newline
	Command cmds[] = makeCommands("Ok","Cancel");
	text.okCommand = cmds[0];
        Command v = Dialog.show(message,text,cmds,Dialog.TYPE_INFO,null);

```	
	
  I'm certain this is related to a recent change in IOSImplementation / updateNativeTextEditorFrame,
the unexpected exit is occurring at line 574

Studying the code and the actual environment, I'm pretty sure this is incorrect:

            int minY = contentPane.getAbsoluteY() + contentPane.getScrollY() + contentPaneStyle.getPaddingTop();
 
The intent is to guess how much room is available.  In this case, contentPane is a panel immediately above
the TextArea, and positioned in the middle of the frame, not up near the top, minY is near the center of the
screen rather than at the top.

ddyer0 avatar Jan 21 '22 06:01 ddyer0

image

ddyer0 avatar Jan 21 '22 06:01 ddyer0

Looks like it just doesn't have room (the keyboard would cover the dialog).

Try adding:

text.putClientProperty("ios.asyncEditing", Boolean.FALSE);

That will disable async editing, and instead shift the whole canvas up to make room for the keyboard.

shannah avatar Feb 03 '22 14:02 shannah

There's actually plenty of room, but I agree this behavior is probably that it thinks there is not. Adding the putClientProperty has no effect image

ddyer0 avatar Feb 03 '22 19:02 ddyer0

What's up with this? Usually when an item is closed there's an accompanying fix or other explanation.

ddyer0 avatar Mar 01 '22 18:03 ddyer0

Looks like it auto-closed because I mentioned this issue in the git commit.

shannah avatar Mar 01 '22 18:03 shannah

I see. This will be testable on Friday?

ddyer0 avatar Mar 01 '22 18:03 ddyer0