Skip to content

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

Closed

Description

@JustinPierce

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

Activity

  1. jgw96 commented on May 15, 2017

    @jgw96
    Contributor

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

  2. added a commit that references this issue on Oct 20, 2017
    fa1985b
  3. ionitron-bot commented on Sep 1, 2018

    @ionitron-bot

    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.

  4. locked and limited conversation to collaborators on Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions