3

I am looking for a way to dismiss the select picker found in the iOS Safari once a option element is being selected.

We can trigger the whole thing with OnChange, but the picker is still open.

I tried .blur() and .blur(function() { window.clearInterval(interval); })

We are running with jQuery installed.

The process should be :

  1. User taps the select box
  2. Options appear in the built-in browser picker
  3. User taps an option
  4. Script loads
  5. Picker goes away afterwards (this is the step missing)
Nils Munch
  • 8,805
  • 11
  • 51
  • 103
  • Im not sure you can - the user is required to click the `Done` button first ... unless you can show me an example of where you dont ! – Manse Jan 06 '12 at 12:15
  • 2
    I dont think the change event fires until the `done` button is pressed - im trying to test now ! – Manse Jan 06 '12 at 12:33
  • The change event doesnt first until the `done` button is pressed ... couldn't work round it ! – Manse Jan 10 '12 at 21:04
  • 1
    I suggest you to go to alternative solution since the keyboard/datepicker can stimulate DOM events, but the reverses doesn't work at most of the time. (most likely undocumented, you most need to expose the global object space via firebug or using remote debugger if you still go to that way) – vincicat Jan 17 '12 at 03:52

2 Answers2

0

You can bind the onblur event handler to the input elements and check in the handler if any of them have focus (using document.activeElement). As given in this answer to a similar question.

Community
  • 1
  • 1
jjclarkson
  • 5,890
  • 6
  • 40
  • 62
0

You can try triggering an event which doesn't require the picker.

$('#foo').trigger('click');

Also make sure your event handlers return false.

Liam
  • 2,837
  • 23
  • 36