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

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

Open
brian-smith-tcril opened this issue Feb 13, 2024 · 1 comment
Open

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

brian-smith-tcril opened this issue Feb 13, 2024 · 1 comment
Assignees

Comments

@brian-smith-tcril
Copy link
Contributor

from openedx/frontend-app-authn#1133 (comment)

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

{helpMessage && isValid && (
<FormControlFeedback type="default">
{helpMessage}
</FormControlFeedback>
)}
{!isValid && (
<FormControlFeedback type="invalid" feedback-for={controlProps.name}>
{errorMessage}
</FormControlFeedback>
)}

FormControlFeedback.defaultProps = {
hasIcon: true,
type: undefined,
icon: undefined,
className: undefined,
muted: false,
};

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 brian-smith-tcril self-assigned this Feb 13, 2024
@brian-smith-tcril
Copy link
Contributor Author

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

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

No branches or pull requests

1 participant