openedx / paragon

💎 An accessible, theme-ready design system built for learning applications and Open edX.
https://paragon-openedx.netlify.app
Apache License 2.0
118 stars 66 forks source link

expose `FormControlFeedback` (props?) in `Form.Autosuggest` #3004

Open brian-smith-tcril opened 6 months ago

brian-smith-tcril commented 6 months ago

from https://github.com/openedx/frontend-app-authn/issues/1133#issuecomment-1940664097

In addition to the missing onErrorStateChange, the reason for not using the internal error state provided by Form.Autosuggest is the way it renders error. It is prefixed with "x" icon with no way to remove it. All other errors on Authn don't have it and this makes the form errors inconsistent.

This is happening because we are using default props for FormControlFeedback in Form.Autosuggest, meaning hasIcon is always set to true

https://github.com/openedx/paragon/blob/2801667f79d4a8edea101d35bc77d982a2f0c14e/src/Form/FormAutosuggest.jsx#L333-L343

https://github.com/openedx/paragon/blob/2801667f79d4a8edea101d35bc77d982a2f0c14e/src/Form/FormControlFeedback.jsx#L48-L54

The simplest solution to this exact use case would be to just expose hasIcon, but it's worth exploring how/how much of FormControlFeedback we want to expose here.

brian-smith-tcril commented 6 months ago

https://paragon-openedx.netlify.app/components/datatable/#paginated-selection example of bulk actions components being passed in was discussed in Paragon WG. I will try following that pattern to implement this