Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Touch events close dropdown but click events do not. #99

Open
jifalops opened this issue Aug 8, 2016 · 1 comment
Open

Touch events close dropdown but click events do not. #99

jifalops opened this issue Aug 8, 2016 · 1 comment

Comments

@jifalops
Copy link

jifalops commented Aug 8, 2016

Description

In a paper-menu-button where the dropdown-content is a div containing various elements (not selectables), clicking around in the dropdown does not close it when on the computer (good). If I open dev tools, simulate a phone, and touch/tap anywhere in the dropdown-content, it closes.

Expected outcome

Consistent behavior, preferably not closing until I click outside of the dropdown.

Actual outcome

Mouse: click inside without close.
Touch: click inside causes close.

Browsers Affected

  • [x ] Chrome
@bennypowers
Copy link

I have this same issue with the following markup:

<paper-menu-button id="menu"
    dynamic-align
    ignore-select
    close-on-activate="false"
    restore-focus-on-close
    >
  <paper-icon-button id="button" class="dropdown-trigger"></paper-icon-button>
  <iron-pages id="dropdown"
      class="dropdown-content"
      selected="[[page]]"
      attr-for-selected="id"
      fallback-selection="auth"
      role="main">
    <eve-auth-ui id="auth" auth="[[auth]]"></eve-auth-ui>
    <eve-profile id="profile" auth="[[auth]]"></eve-profile>
  </iron-pages>
</paper-menu-button>

Note that even with ignore-select and close-on-activate="false", tap events close the dropdown.

Workaround

Add on-tap="_handleTap" to the dropdown element (in my case, iron-pages#dropdown). The tap handler should do nothing.

_handleTap: function (e) {/*HACK: Prevent dropdown from closing on touch-events*/},

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