0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

iOS,Android input type="date" JavaScriptイベント取得まとめ

Last updated at Posted at 2020-06-03

##はじめに
Javascriptでinput="date"のイベント取得をiOS,Androidで調べたのでまとめ

##検証環境
iOS 13.3
ブラウザ Safari

Android 8.0.0
ブラウザ Chrome

##iOS

操作 イベント
フォーカス onchange
日付切り替え onchange
消去 onchange
完了 onblur

完了を押下するとフォーカスが外れるため'onblur'が発火するっぽい

##Android

操作 イベント
フォーカス -
日付切り替え -
削除 onchange (日付が入力済みの場合)
キャンセル -
設定 onchange

比較

ios Android
フォーカス onchange -
日付切り替え onchange -
消去・削除 onchange onchange
キャンセル - -
完了・設定 onblur onchange

sample

alertだとダイアログを消した際に、blurが発生し続ける見たいだったので、HTML出力

See the Pen sample date by shotaabe (@shotaabe) on CodePen.

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?