freqdec/datePicker

Safari fires an error

Closed this issue · 15 comments

The error that I have on Safari 6.0.5 desktop and iOS 7 mobile Safari :

TypeError: Attempted to assign to readonly property. on line 144.
No error in Chrome or Safari on the same thing.

Hi Gaëtan,

This will be difficult for me to fix as I have no Mac and no iPhone (yep, there actually is someone!). I've an iPad lying around somewhere - shall have to update to iOs7 and see what happens...

Hi Freqdec,
The bug is visible on Safari on ios6 too. (Sorry my previous comment was vague)

+1 : This datepicker various testing demos (http://freqdec.github.io/datePicker/demo) don't work on Safari 6 (used Safari version 6.0.5 / 8536.30.1 on a Mac OS X 10.8.5).

In absolute, the Safari error (unminified version) should have been easy to "workaround", since it's a known Safari 6 bug (http://craigsworks.com/projects/forums/showthread.php?tid=3649):

1 - remove "use strict" on line 1

2 - change the way you access the defaultVal property on line 3258:

options.formElements[elemID],defaultVal = ...

should be changed into

options.formElements[elemID]['defaultVal'] = ...

But unfortunately it is not sufficient to make this calendar work on Safari :-(

Hi Ronan,

Is there another error thrown even when the new defaultVal code is used?

unfortunately, no : Js console remains quiet, but no datepicker appears.

+1 for Safari support

Hi Guys,

Back from the dead but still can't fix the bug. I have a 20 dollar paypal bounty for anyone who can though. Just send a pull request with the fix.

Sorry - that's the best that I can do at this time.

bump

Seems to work now except 1 thing: the calendar icon seems to be inaccessibly by the keyboard.

Hi Guys,

Looks like Damien gets the reward (Damien, if you want it in euro that's no problem - remember to send me your details so I can send the payment).

Unfortunately, my laptop died to merging the code etc shall have to wait until I buy another and restore git etc...

Also, I think Safari will never tab to controls unless you have specifically told it to do so in the preferences.

Damien, just sent 30 AUD to you via Paypal. Many thanks for the fix.

@freqdec No probs at all, thanks for the reward 👍

I'm not really sure... but it can't work. options.formElements[elemID] is a string.

How about merging this one?

Fixed in latest version.