This application was built with the intent of reproducing an Ionic v3 issue where the picker
displayed by ion-datetime
does not inherit the provided mode
attribute on the datetime
component.
The issue occurs on both iOS and Android. For this repo, I'm providing reproduction steps for iOS.
These steps assume the following:
- You have Xcode 9 or 10 installed
- You have an Apple Developer account installed & configured for running Ionic applications locally (note: you may need to change your provisioning profile / code signing in Xcode when running the app locally)
- You have the Ionic CLI & npm/NodeJS installed
- You have Safari's Developer Tools enabled
- Download this project as a ZIP export & unzip to a local directory
- Open Terminal and navigate to the dir
- Run
npm i
- Run
ionic cordova platform add ios
- The next step depends on the version of Xcode you're using.
5a. If Xcode 9 is installed, run:
ionic cordova run ios
5b. If Xcode 10 is installed, run:
ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0"
- When the simulator is running, open Safari on your local machine
- Navigate to the simulator in Safari's Develop menu and open localhost
- Inspect the DOM and search for the
datetime
component - notice it is properly denoted with themd
attribute - Now click or tap on the input (
datetime
) field to bring up thepicker
- Inspect the DOM again for the
picker
component; note that it does not inherit the samemd
attribute (picker-ios
)
- This occurs on both devices and simulators (only tested on iOS 12+)
- This does not occur for an Ionic 4 application (only v3)