react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

feat: Allow ReactNode as children/content of the Toast - closes #6038

Open radosek opened this issue 1 year ago • 4 comments

Closes #6038

✅ Pull Request Checklist:

  • [x] Included link to corresponding React Spectrum GitHub Issue.
  • [x] Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • [x] Filled out test instructions.
  • [x] Updated documentation (if it already exists for this component).
  • [x] Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

yarn jest

radosek avatar Mar 27 '24 23:03 radosek

@snowystinger

If the team decides for text parse, is it okay to use additional property in options (like allowHtmlParse) to skip unnecessary RegEx checks for better perf?

radosek avatar Mar 29 '24 07:03 radosek

I was thinking very simple. IE, only allow bold. I'm not too worried about perf, it's a short string for an element that doesn't appear frequently and shouldn't rerender much.

snowystinger avatar Mar 29 '24 07:03 snowystinger

I guess that would be good to include also a span tag for the possibility of adding class to specific parts of the text. Might not be up to Adobe internal guidelines, but useful for third-party.

radosek avatar Mar 29 '24 09:03 radosek

We should be talking about this later this week.

However, you brought up an important point. Which is that this is useful for non-spectrum users. We intend to make a RAC toast implementation which should alleviate this particular use case.

snowystinger avatar Apr 01 '24 23:04 snowystinger

RAC Toasts have landed in alpha https://react-spectrum.adobe.com/react-aria/Toast.html you handle rendering Toasts yourself so can put whatever you like into it. Do you still need this particular PR?

We've still not landed on a good solution for Spectrum side of things

snowystinger avatar Apr 09 '25 00:04 snowystinger