Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Source/AlphaTab.JavaScript/UI/BrowserUiFacade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,13 @@ public IContainer GetScrollContainer()
var nodeName = scrollElement.NodeName.ToLowerCase();
if (nodeName == "html" || nodeName == "body")
{
scrollElement = Browser.Document.DocumentElement;
// Some mobile browsers cannot scroll on html, we must scroll on body instead
// http://blog.jonathanargentiero.com/jquery-scrolltop-not-working-on-mobile-devices-iphone-ipad-android-phones/
// https://github.com/CoderLine/alphaTab/issues/205
string userAgent = Browser.Navigator.UserAgent;
scrollElement = userAgent.Match("((iPod|iPhone|iPad|Android))").IsTruthy()
? Browser.Document.Body
: Browser.Document.DocumentElement;
}

return new HtmlElementContainer(scrollElement);
Expand Down