Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<ion-datetime> strips handlers from custom buttons specified in pickerOptions #11641

Closed
JustinPierce opened this issue May 12, 2017 · 2 comments

Comments

@JustinPierce
Copy link

Ionic version: (check one with "x")
[ ] 1.x
[ ] 2.x
[x] 3.x

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
If you specify custom buttons for an <ion-datetime> component, those buttons will be rendered, but clicking them will not do anything.

Expected behavior:
Clicking the custom buttons should execute their handler functions.

Steps to reproduce:
See the Plunkr below (running Ionic 3.2.1). The custom date picker button and the button on the page itself are hooked up to the same event handler, but only one produces an effect.

http://plnkr.co/edit/mOrDBPcWxXB0L2sFjHFJ?p=preview

Other information:
While stepping through the code for the <ion-datetime> component, I found that the handler property was present until this line is called in `datetime.ts:

const pickerOptions = deepCopy(this.pickerOptions);

It appears that the deepCopy() function is stripping off the handler property.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Your system information:

 ordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.0
Xcode version: Not installed
@jgw96 jgw96 added the v3 label May 15, 2017
@jgw96
Copy link
Contributor

jgw96 commented May 15, 2017

Thanks for opening an issue with us, we will look into this.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 1, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants