<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Stone Umbrella Consulting</title>
	<atom:link href="http://www.stoneumbrella.com/su/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stoneumbrella.com/su</link>
	<description>Design, Database, Application Development, Hosting</description>
	<lastBuildDate>Tue, 02 Nov 2010 15:22:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>PhoneGap Detect Keyboard Close (iPhone)</title>
		<link>http://www.stoneumbrella.com/su/2010/11/02/phonegap-detect-keyboard-close-iphone/</link>
		<comments>http://www.stoneumbrella.com/su/2010/11/02/phonegap-detect-keyboard-close-iphone/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 15:22:10 +0000</pubDate>
		<dc:creator>nate</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[PhoneGap]]></category>

		<guid isPermaLink="false">http://www.stoneumbrella.com/su/?p=344</guid>
		<description><![CDATA[It took about 5 hours, but I finally figured out how to detect when the keyboard closes.  The essential problem is that when the keyboard opens, the webview slides up to ensure the text field stays in view. When it closes, the screen doesn&#8217;t slide back up to restore the original view.   If you [...]]]></description>
			<content:encoded><![CDATA[<p>It took about 5 hours, but I finally figured out how to detect when the keyboard closes.  The essential problem is that when the keyboard opens, the webview slides up to ensure the text field stays in view.</p>
<p>When it closes, the screen doesn&#8217;t slide back up to restore the original view.   If you have a single-page app, there are solutions that trigger on various events (scroll, touchmove), but I have a multi-view app that breaks those solutions.</p>
<p>Essentially, you just listen for &#8220;blur&#8221; events on the fields themselves.  When the keyboard closes, the text field in question gets a &#8220;blur&#8221; event and you can call &#8220;window.scrollTo(0,0).</p>
<p>Example:</p>
<pre>$("textarea").bind("blur", function(e) {
    window.scrollTo(0.0);
});</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.stoneumbrella.com/su/2010/11/02/phonegap-detect-keyboard-close-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

