Re: UIWebView not updating picker when picking dynamically populated select items
Re: UIWebView not updating picker when picking dynamically populated select items
- Subject: Re: UIWebView not updating picker when picking dynamically populated select items
- From: Conrad Shultz <email@hidden>
- Date: Wed, 05 Oct 2011 12:28:07 -0700
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10/5/11 12:04 PM, Ron Wagner wrote:
> I have an app with a UIWebView. The contents of the UIWebView
> contains two html <select> items. When the first select item is
> changed, javascript on that <select> item populates the second
> <select> time according to the selection of the first <select>
> item.
>
> The problem I am experiencing is that when tapping on the first
> <select> item, Safari brings up a Picker for the <select> item,
> along with a view above the Picker containing Previous and Next
> buttons. When clicking on the Next button, the Picker stays in
> place and the second <select> item is focused, but the Picker
> doesn't update to display the newly updated contents of the second
> <select> item, which was populated by the first <select> item's
> onChange javascript.
>
> I am about to file a bug report against WebKit for this, but am
> looking for a workaround. I realize that this might be more of a
> Safari list question, but since it is in an app using a UIWebView
> I'm willing to attack it from either side if anyone has any ideas.
There are undoubtedly people on the list (and elsewhere) far more
skilled than I in these sorts of issues, but I'll throw out a couple
naive ideas.
I presume that you have otherwise tested this behavior and that the
problem only manifests when "Next" is used (instead of tapping on the
page body, thus resigning first responder)? If so, that does rather
sound like a WebKit bug. (I'm also assuming that you meant
"UIWebView" instead of "Safari" in your message.)
As a workaround, maybe try using a different event. Instead of
"onchange" (note: event names are technically supposed to be
non-camel-cased: http://www.w3.org/TR/html4/interact/scripts.html),
what happens if you use "onblur" on the first <select> or "onfocus" on
the second <select>?
It might also help (for your bug report if no other reason) to
determine whether the issue is WebKit failing to trigger the
"onchange" event or the second <select> failing to honor the change.
If you through in an alert() or equivalent into your "onchange" code
it should be pretty easy to distinguish. If the problem is <select>
failing to honor the change, you might be SOL (or at least would have
to find some more convoluted approach that does trigger an update).
- --
Conrad Shultz
Synthetiq Solutions
www.synthetiqsolutions.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iD8DBQFOjK/GaOlrz5+0JdURAtHpAJ9sqeto7O3ElcE9KnbXa7vy2E6EmwCdGFnj
2gcRn68bVR0CCyC2lwcLypg=
=izgR
-----END PGP SIGNATURE-----
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden