Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In iPad: Combo boxes do not open selections #2571

Closed
JTBrandao opened this issue Oct 4, 2018 · 10 comments
Closed

In iPad: Combo boxes do not open selections #2571

JTBrandao opened this issue Oct 4, 2018 · 10 comments
Assignees
Milestone

Comments

@JTBrandao
Copy link

This issue occurs only when running on iPad. The same build (published on APP Store) runs correctely on iPhone´s.

We´ve tested on iPhone 6s in versions 11.4.1 and 12.0 and it runs correctely.
In iPad Mini running same versions 11.4.1 and 12.0 the bug occurs.

@JTBrandao
Copy link
Author

Note: We are using the new class BrowserComponent of CN1.

@codenameone
Copy link
Collaborator

We need sample code that reproduces the issue and ideally screenshots

@JTBrandao
Copy link
Author

We are initially attaching images which evidence the problem:

The first image was taken from the APP (downloaded from App Store) running on iPad (iOs version 12.0) and shows a simple form containning just one select component: When we tap the selection nothing occurs:
20181005_172017479_ios

The second image was taken from the same APP (downloaded from App Store) running on iPhone 6s (iOs Version 12.0) and shows the same simple form containning just one select component: When we tap the selection the options are presented correctly for selection:
20181005_171931185_ios

We´ll next work on a simple project do help isolationg the problem.

Thanks for first return.

@codenameone
Copy link
Collaborator

Is that with a web UI?
We need a test case that reproduces the issue.

@JTBrandao
Copy link
Author

The link bellow has a simple project for diagnosis.
https://github.com/hrugani/cn1HtmlComboxProblem

@codenameone codenameone added this to the Version 6.0 milestone Oct 13, 2018
@codenameone
Copy link
Collaborator

I found multiple mentions of a problem related to select in newer versions of iOS e.g. https://forums.developer.apple.com/thread/84585
The workarounds seem to vary a lot and no one knows exactly what fixed the issue but it's clearly a bug in iOS.

@shannah One of the suggestions was to migrate to WKWebView which is probably something we should do regardless and it might resolve this issue. What do you think?

@JTBrandao
Copy link
Author

If that migration to WKWEBVIEW will be compatable with the new CN1 Bridge-Java-JavaScript-API we think this approach is valid.

@shannah
Copy link
Collaborator

shannah commented Oct 15, 2018

WKWebview is the way to go long-term. But there will likely be some compatibility hiccups. It enforces CORS where UIWebView did not, and it apparently has issues with file:// URLs, so we would need to embed a local webserver...

I won't know the full extent of the issues until I implement it.

@codenameone
Copy link
Collaborator

In that case we would probably need to make this optional. Ideally in runtime so a developer can decide. If not maybe as an #ifdef but that's far less ideal. By default WK would need to be disabled if this is the case. I don't think shipping a webserver by default is something we should get into.

@shannah
Copy link
Collaborator

shannah commented Oct 17, 2018

This issue is related to z-layering. I can reproduce it on both iOS 11.4 and iOS 12.0.1 on my iPad Air 2. If I switch off Z-layering, the test case works.

Looking into it further to see if I can find a fix.

shannah added a commit that referenced this issue Oct 17, 2018
This turned out to be an issue with the way we were doing Z-Layering.  When adding a peer component, we were adding a peer components UIView to the parent of the root view.  Unfortunately, this technically places it outside the view hierarchy - even though it appeared to work.  Resolved the problem by instead re-rooting the view hierarchy with a new UIView above the previous EAGLView.  There were some places where the view controller (CodenameOne_GLViewController) would call self.view and expect that it would be the EAGLView.  This can no-longer be assumed.  If there have been any peer components added, then self.view will return the new UIView root (the parent of the EAGLView).

To help with this, I added a new eaglView method in CodenameOne_GLView controller which will always return the EAGLView.  I have swapped out all of the places where an EAGLView was explicitly assumed via cast.  It is possible that there are other situations where it is implicitly assumed, but we'll have to squash those as we find them.

Also added a macro EAGLVIEW for [[CodenameOne_GLView Controller] instance] eaglView] for convenience.

Tested with a few different apps in test suite so far and appears to not have broken anything - but this is a pretty low-level change so it could have far-reaching effects.
@shannah shannah closed this as completed Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants