ember-cli-notifications icon indicating copy to clipboard operation
ember-cli-notifications copied to clipboard

[BUGFIX] click event on links in notification message

Open Shajansheriff opened this issue 5 years ago • 4 comments

Fix 269

Shajansheriff avatar Mar 26 '20 14:03 Shajansheriff

Closes #274

jacobq avatar May 12 '20 05:05 jacobq

@Shajansheriff I think a better solution to this would be to move the close button outside of the div that has the onClick handler and absolutely position it to the top right inside the outer container. That way we don't need to stop propagation. Of course the outer container should have position: relative. What do you think?

LuisAverhoff avatar Mar 07 '21 17:03 LuisAverhoff

@LuisAverhoff no that workaround is not applicable. This fix and the issue is about having links in notification content that become unclickable.

bjornharrtell avatar Mar 08 '21 15:03 bjornharrtell

@bjornharrtell

The fix proposed by @Shajansheriff involves calling event.stopPropagation and that is only because he is using the on modifier which ignores parameters like bubbles=false, preventDefault=false etc unlike the action modifier(If I recall correctly, it automatically prevents the default action). The alternative fix that I propose makes calling event.stopPropagation unnecessary because the event will no longer bubble to the onClick handler and prevent the default action from being called when clicked. The problem really boils down to circumventing the bubbling phase that occurs in events and there are multiple ways we can go about it. The one that I proposed is one of them.

LuisAverhoff avatar Mar 08 '21 16:03 LuisAverhoff