Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] - fwLinkClick event not getting triggered on FwToastMessage Component #844

Open
sarveswaran-ramanathan opened this issue Apr 18, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@sarveswaran-ramanathan
Copy link

Component
FwToastMessage

Describe the bug
When using ToastController, FwToast to toast FwToastMessage with action-link-text, the event fwLinkClick is not getting triggered on clicking the linkg

To Reproduce
Steps to reproduce the current behavior:

  1. Have a FwToastMessage with action-link-text
  2. Using ToastController or FwToast trigger the FwToastMessage.
  3. Click on the link.
  4. fwLinkClick is not getting emitted.

Expected behavior
fwLinkClick should be emitted for us to handle.

code
https://codesandbox.io/s/frosty-wood-o78453?file=/src/App.js:0-1760

@sarveswaran-ramanathan sarveswaran-ramanathan added the bug Something isn't working label Apr 18, 2023
@arvindanta
Copy link
Collaborator

@sarveswaran-ramanathan

Can you either use

window.addEventListener("fwLinkClick", (e) => {
    console.log(e.target); // check the e.target and perform actions based on the target clicked.
    alert("link clicked");
  });

or

you can create a custom link urself instead of using the action-link-text prop

<fw-toast-message type="success" id="custom-toast" timeout="6000">
      <div>
        <span class="custom-text">Custom content</span>
        <h4>custom html contents can be added</h4>
        <a href="#" onclick="alert('clicked')">custom link</a>
      </div>
</fw-toast-message>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants