materialize icon indicating copy to clipboard operation
materialize copied to clipboard

TapTarget / FeatureDiscovery does not allow clicking on links while open

Open rustyricky opened this issue 8 years ago • 3 comments

Expected Behavior

When TapTarget / Feature Discovery is open I can still click on other links.

Current Behavior

Hover function work fooling you into thinking you can click a link, but the first click on a link/button only closes the Feature Discovery. The second clicks then follows the link

Steps to Reproduce (for bugs)

Click the toggle button in this Codepen: https://codepen.io/anon/pen/pVzqVJ Then when the Feature Discovery is open try to click on the link below. The Feature Discovery will now close and the second click will follow the link (though it may not work well because it's embedded in Codepen)

Context

I have a side nav and want to promote the features in the current view but still want the user to be able to view other pages without manually closing the Feature Discovery first

Your Environment

  • Version used: 1.0.0-beta
  • Browser Name and version: Firefox 59.0.2 x64
  • Operating System and version (desktop or mobile): Pop_Os (Ubuntu) on Desktop

rustyricky avatar Apr 17 '18 19:04 rustyricky

I had the same issue and fixed it with the onClose callback:

options = {
    onClose: (elem) function() {
        var target = event.target;
        setTimeout(function() {
            target.click()
        }, 300)
    }
}

I added the 300 ms delay to let the tap target close before clicking the link element to prevent the animation from becoming laggy.

benjaminwols avatar Oct 04 '18 13:10 benjaminwols

This certainly does not look right, but here is a workaround, assuming you want to navigate from the page: https://codepen.io/smoore4moma/pen/wRExPW

  var options = {
    onOpen: () => console.log("Open"), 
    onClose: () => window.location(this.href)
  }

It's notable that no workaround is needed if the target is _blank.

smoore4moma avatar Jan 10 '19 11:01 smoore4moma

The idea is that you don't want to navigate from the page, it is just that clicking on an element in the "FeatureDiscovery" bubble calls back on leaving it open.

The solutions above don't work.

I tried that and it gets into an infinite loop: options = { onClose: (elem) function() { var target = event.target; setTimeout(function() { target.click() }, 300) } }

kaziqta avatar Mar 25 '19 15:03 kaziqta