TapTarget / FeatureDiscovery does not allow clicking on links while open
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
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.
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.
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)
}
}