PolymerElements / iron-overlay-behavior

Makes an element an overlay with an optional backdrop
41 stars 71 forks source link

Cancel event of "iron-overlay-behavior" is triggered before the On-Click of the element on emulated device mode and mobile devices #306

Open chanshachans opened 4 years ago

chanshachans commented 4 years ago

Description

An overlay is opened by the on-click method of a button using toggle event of "iron-overlay-behavior" and when clicking on the same button to close the overlay to call the toggle event. The Cancel event of "iron-overlay-behavior" is triggered before the on-click method on emulated device mode and mobile devices on chrome. Same case is working fine on desktop. code: on-click="click" click() { this.$.element.toggle(); }

Expected outcome

Overlay needs to close on clicking the same button used for open on emulated device mode and mobile devices on chrome. i.e On-click event needs to be triggered 1st and then cancel event needs to be triggered

Actual outcome

Overlay opens on on-click events, but doesnt closes on calling the toggle event in on-click function on emulated device mode and mobile devices. i.e Cancel event is triggered before the On-click event.

Live Demo

Steps to reproduce

Example

  1. Put a button which opens the overlay element on-click of it in the page.
  2. In the on-click(), call the toggle event for the overlay i.e. this.$.element.toggle()
  3. Open the page in a dev-tools with responsive mode(tablets,ipad) on chrome.
  4. Click on the button, opens the overlay using the toggle().
  5. Again, click on the same button to close the overlay with toggle().But,It doesn't closes it.

Browsers Affected