This repository was archived by the owner on Oct 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
Unable to close dialog within a UIWebView on iOS #2190
Copy link
Copy link
Closed
Description
The 'X' button, and 'data-rel="back"' links in a dialog are ignored when running in an embedded browser on iOS devices. When running from Safari the close button works fine, but when running from a UIWebView the X button is ignored.
Using the latest build "92ceadf138379eed3583d58994886b94fcf227ea Date: Tue Aug 2 07:25:13 2011 -0700" I am able to reproduce this with a clean test. The offending html is:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Mobile Framework - Dialog Example</title>
<link href="http://code.jquery.com/mobile/latest/jquery.mobile.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.6.2.js"></script>
<script src="http://code.jquery.com/mobile/latest/jquery.mobile.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>iOS Dialog Test</h1>
</div>
<div data-role="content">
<a href="#dialog-inline" data-role="button" data-rel="dialog" data-close-btn-text="foobar">open inline dialog</a>
</div>
</div>
<div data-role="page" id="dialog-inline">
<div data-role="header">
<h1>Dialog inline</h1>
</div>
<div data-role="content">
<p>This is a dialog. When running in an iOS UIWebView the Close button does nothing.</p>
<a href="dialog.html" data-role="button">Page Navigation</a>
<a href="#" data-role="button" data-rel="back">close</a> <!-- Link is broken -->
</div>
</div>
</body>
</html>
You can download an Xcode project (tested in Xcode 3.2 and 4.1), the project creates a UIWebView and loads the above html. http://dl.dropbox.com/u/47403/DialogTest.zip