Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What triggers the blur event on mobile safari (iPad)

I have a datepicker controller that I want to blur when the user touches somewhere on the screen that is not the datepicker. The problem that Im having with this is that I dont understand what triggers the blur event. For example if the user touches next month the blur event is triggered, so I would like to say, ok if the relatedTarget is a class inside the datepicker (next month) then show the next month and dont hide the datepicker, if the relatedTarget is not on the calendar hide it. The problem is that relatedTarget is always undefined.

So I have two questions:

  1. What trigers the blur event on mobile Safari?
  2. Why is the event.relatedTarget property always undefined in mobile Safari?
like image 670
woolagaroo Avatar asked Nov 06 '22 02:11

woolagaroo


1 Answers

Found out here: http://developer.apple.com/library/IOs/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW5

the following note: "iOS Note: Although drag and drop are not supported, you can produce the same effect using touch events as described in “Using Touch to Drag Elements” in Safari CSS Visual Effects Guide. The unload event may not work as expected for back and forward optimization. Use the pageshow and pagehide events instead."

HTH

like image 114
ydaniv Avatar answered Nov 10 '22 17:11

ydaniv