iOS: fix status-bar tap scroll-to-top on device (#3589)#4857
Merged
shai-almog merged 1 commit intomasterfrom May 3, 2026
Merged
iOS: fix status-bar tap scroll-to-top on device (#3589)#4857shai-almog merged 1 commit intomasterfrom
shai-almog merged 1 commit intomasterfrom
Conversation
The hidden UIScrollView used to receive the iOS status-bar tap (scrollViewShouldScrollToTop:) was effectively invisible to the system on real devices for two reasons: its contentSize (1x2) was smaller than its full-screen frame so iOS treated it as not actually scrollable, and userInteractionEnabled was NO which excludes the view from scroll-to-top dispatch on recent iOS versions. Even when those were addressed, any on-screen WKWebView/UIWebView/UITextView (whose internal scroll views default to scrollsToTop=YES) created an ambiguity that caused iOS to deliver the message to no one. - Introduce a CN1StatusBarTapProxyView UIScrollView subclass that returns NO from pointInside: so taps still fall through to the GL view, and keeps contentSize one point taller than its bounds in layoutSubviews so the scroll view stays scrollable across rotations. - Recreate the proxy with userInteractionEnabled=YES and re-attach / bring it to the front from viewDidAppear: so peers added after viewDidLoad don't bury it. - Set scrollsToTop=NO on the editing CN1UITextView and on UIWebView / WKWebView's embedded scrollViews so they don't compete with the proxy.
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
scrollViewShouldScrollToTop:to one UIScrollView in the window.UIScrollViewhad two latent bugs that broke that delivery on device:contentSize(1x2) was smaller than its full-screen frame so iOS treated it as not actually scrollable, anduserInteractionEnabled = NOexcludes the view from scroll-to-top dispatch on recent iOS versions.WKWebView/UIWebView/UITextView(whose internal scroll views default toscrollsToTop = YES) created an ambiguity that caused iOS to deliver the message to no one.Changes
CodenameOne_GLViewController.mCN1StatusBarTapProxyViewUIScrollView subclass that returnsNOfrompointInside:withEvent:so taps still pass through to the GL view, and overrideslayoutSubviewsto keepcontentSizeone point taller than its bounds across rotations.cn1InstallStatusBarTapProxynow creates that subclass withuserInteractionEnabled = YES, idempotently re-attaches if already created, and is also called fromviewDidAppear:so native peers added afterviewDidLoaddon't bury the proxy.scrollsToTop = NOon the multiline editingCN1UITextView.IOSNative.m—scrollsToTop = NOon the embeddedscrollViewof bothUIWebViewandWKWebView.Test plan
paintsTitleBarBool:true,statusBarScrollsUpBool:true, a Form with 30 Labels) and confirm tapping the status bar scrolls back to the top.BrowserComponenton screen and with a focused multi-lineTextArea— both used to silently disable the status-bar tap because of the multiple-scroll-views conflict.pointInside:returns NO so it must not consume any touches.🤖 Generated with Claude Code