Skip to content

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

Open
sbsangu wants to merge 1 commit into
fkhadra:mainfrom
sbsangu:fix/onButtonClose
Open

Feature/Added prop for passing function when close button is clicked#1133
sbsangu wants to merge 1 commit into
fkhadra:mainfrom
sbsangu:fix/onButtonClose

Conversation

@sbsangu

@sbsangu sbsangu commented Jul 7, 2024

Copy link
Copy Markdown

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

sbsangu commented Jul 16, 2024

Copy link
Copy Markdown
Author

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

1 participant