Skip to content

Closing modal to reset date selection #262

@db-qc

Description

@db-qc

Hi!

So I had something I thought would be quite simple to achieve. Currently, when the modal is closed, the date selection currently selected is set. What I wanted to do was when the modal is closed (i.e. without hitting 'apply'), I wanted to cancel the current selection.

I have tried resetting the picker.element.val using picker.oldStartDate and picker.oldEndDate when onHide was called, which kind of works but this causes a problem when I try and use onApply as onHide called before on apply.

I tried using onEvent but that's fired twice, so even if I'm listening to a certain event it fires twice.

What I'd really like to achieve is replicating exactly what the 'Cancel' button does - which I thought would be simple :D

Does anyone have an idea on how to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions