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

Pikaday close event confuses ember basic dropdown #191

Open
andrew-paterson opened this issue Jul 17, 2018 · 2 comments
Open

Pikaday close event confuses ember basic dropdown #191

andrew-paterson opened this issue Jul 17, 2018 · 2 comments

Comments

@andrew-paterson
Copy link

andrew-paterson commented Jul 17, 2018

I'm not sure if this belongs here, as this is more a conflict with another addon than a pikaday specific problem.
If a pikaday component is inside the content of an ember-basic-dropdown component, the dropdown closes as soon as a date is clicked. It seems that the close event for the pikaday calendar is bubbling up tothe dropdown.

    {{#basic-dropdown renderInPlace=true as | dd | }}
        {{#dd.trigger class=triggerClasses eventType="click" }}
            <button class="secondary">Show date picker</button>
        {{/dd.trigger}}
        {{#dd.content }}
            {{pikaday-input format="MM/DD/YYYY" onSelection=(action 'doSomethingOnSelection') onClose=(action 'doSomethingOnClose') bubbles=false}}
        {{/dd.content}}
    {{/basic-dropdown}}

I have tried it with a more simple popout and it works correctly:

    <button {{action 'toggleFoo'}}></button>
    {{#if foo}}
        {{pikaday-input format="MM/DD/YYYY" onSelection=(action 'test') onClose=(action 'doSomethingOnClose') bubbling=false}}
    {{/if}}

Is there a way to stop the close event of pikaday from bubbling up in such a case?

@scottkidder
Copy link
Collaborator

@andrew-paterson Can you put together a twiddle?

@asjongers
Copy link
Contributor

Hmmm, I've never used ember-basic-dropdown but it could be that it detects any click outside its DOM element and, as the date selector in pikaday-input is not rendered in place (from what I've seen at least), the close action of ember-basic-dropdown gets triggered.

I think the pikaday-inputless is rendered in place so it could be a good starting point to check if it is indeed the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants