amsul / amsul/pickadate.js

onSet returning a Number on Mouse selection, an Object on select via Keyboard (pressing enter)

オープン
#561 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
todo
主要言語
JavaScript
スター
7.6k
フォーク
981
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello,

One of my clients discovered that the date wasn't saved correctly when he was tabbing through a form and selecting the value of the datepicker via the keyboard and pressing enter.

Upon debugging the issue, I noticed that indeed the datepicker supplies different values, depending on whether the keyboard or the mouse was used to trigger the selection:

Code in onSet - callback:

```
onSet: function(context) {
console.log(context, typeof context.select);
}
```

Selecting a date with the mouse returns this:

```
Object {select: 1416355200000} "number"
```

Selecting a date via keyboard returns this:

```
Object {select: Object} "object"
```

The object looks nice, and I can definitely use it, but I just wanted to let you know that it's an issue people who would use onSet: without testing keyboard interaction could stumble about:

![image](https://cloud.githubusercontent.com/assets/3845924/4968173/47ea8654-6836-11e4-9889-17b27906f727.png)

Anyways, the datepicker itself is awesome, and very well supported, very professional, I can't thank you enough.

Best wishes

Daniel

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。