I would love to test out the patch, but I am not sure how to check out
files, or apply the patch through this CVS.

I'm sure you noticed it, but the Date Picker has a hard time on the
iPhone too because you're generally clicking on an input field.
Focusing the input field causes the keyboard to come up by default and
there is no way around it AFAIK.

My solution was to circumvent the focus of the input element by
disabling it and having another element to call it's "show" method.

$('#datepicker').datepicker();
$('#dateclicker').bind('mousedown',function(){
        $('#datepicker').datepicker('show');
});

<div id="dateclicker" style="height: 25px; width: 200px; border: 1px
solid #000;">Click to get date</div>
<input type="text" id="datepicker" value="" disabled="disabled" />

clearly this isn't the best solution because you have to have extra
elements... but if DatePicker supported more than just input
textfields, you can detect for iPhone, and insert a hidden field
(type="hidden" or type="text" style="vis:hidden" or whatever) into the
form to store the date. I don't think it currently works on hidden
fields... i recall trying those.

On Feb 15, 7:20 am, Paul Bakaus <[email protected]> wrote:
> On Fri, Feb 13, 2009 at 8:17 PM, jason kuhn <[email protected]> wrote:
>
> > Hi all,
>
> > I've came up with a solution to allow most of the UI widgets that
> > depend on mouse events to work on the iPhone. It's a variation of a
> > script that Ross Boucher (http://rossboucher.com/2008/08/19/iphone-
> > touch-events-in-javascript/<http://rossboucher.com/2008/08/19/iphone-%0Atouch-events-in-javascript/>)
> > started, but meant for use with jQuery.
>
> > I have set up a demo of what works and doesn't work (yet). I figured
> > you guys might like to check it out!
>
> > It's a little temperamental, but it's a start. I've noticed that on an
> > actual iPhone/Touch it's slow with animating and dragging, but on the
> > Simulator, it works great.
>
> > demo:http://jasonkuhn.net/mobile/jqui/
> > plugin:http://jasonkuhn.net/mobile/jqui/js/jquery.iphoneui.js
>
> > all you need to do is call .addTouch() on whatever element you want to
> > use touch events to simulate the mouse events.
>
> > ex: $('.drag').draggable({helper: 'clone'}).addTouch();
>
> > Maybe this will be helpful for some iPhone specific UIs...
>
> > Any input or feedback or improvements would be great!
>
> > Enjoy!
> > Jason
>
> Hey Jason,
>
> great work! Very cool timing, in fact, by pure coincidence I developed
> a patch for the next version of jQuery UI (after 1.7) that works
> almost the same.
>
> You'll find it here:http://dev.jqueryui.com/ticket/4143
>
> There's one small but important difference: Instead of delegating or
> forwarding the events, it simply binds the touch* events instead
> as replacement. Only the droppable plugin needed a small fix, because
> it was checking for event.type == 'mousedown'.
>
> I've noticed the same issues you had - resizable doesn't work since
> it uses mouseover events for handle detection. That needs to be refactored
> anyway for the next version. Selectable clicks don't work, as you also
> noticed, but I didn't investigate the cause yet.
>
> There are some performance issues on the actual device though
> right now. They're mainly related to the offset function (iPhone doesn't
> support getBoundingClientRect), and more importantly, the triggering
> of custom events. I'll work on both.
>
> Jason, feel free to try out the patch, and provide any solutions you
> find. Any help is greatly appreciated.
>
> Thanks,
> Paul
>
>
>
> --
> Paul Bakaus
> UI Architect
> --http://paulbakaus.comhttp://www.linkedin.com/in/paulbakaus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to