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

Feature/Added prop for passing function when close button is clicked #1133

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sbsangu
Copy link

@sbsangu sbsangu commented Jul 7, 2024

Fixes

Fixes #1117

Summary

Added an onButtonClose prop to the Toast component to allow users to define a callback function that gets called when the close button of a toast is clicked. This enhancement improves the flexibility and usability of the toast component by allowing custom behavior to be executed when the close button is pressed.

Changes

  • Updated the Toast component to accept and handle a new onButtonClose prop.
  • Updated the ToastContainer component to pass the onButtonClose prop to each Toast component.
  • Updated TypeScript definitions to include the new onButtonClose prop.

Checklist

  • Forked the repository and created a new branch from master.
  • Ran yarn in the repository root.
  • Added tests to cover the new functionality.
  • Ensured the test suite passes (yarn test).
  • Ran yarn start to test changes in the playground.
  • Updated the readme if needed.
  • Updated the TypeScript definitions if needed.
  • Formatted the code with prettier (yarn prettier-all).
  • Ensured the code lints (yarn lint:fix).

Additional Information

This feature allows users to pass a callback function that will be called when the toast's close button is clicked, enabling more custom and dynamic behaviors when a toast is dismissed.

@sbsangu
Copy link
Author

sbsangu commented Jul 16, 2024

Does it resolve issue #1117 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: prop for passing function when close button is clicked
1 participant