-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: add <FormLayout />
component
#814
Conversation
@@ -42,6 +42,7 @@ type FormLayoutTitleProps = { | |||
}; | |||
|
|||
type FormLayoutHelperTextProps = { | |||
id?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
potentially used for aria-describedby
on parent form element
function findSectionTitleInChildren(children: ReactNode) { | ||
// look for the first `FormLayout.Title` or `FormLayout.Section` element. | ||
// if we encounter a Section before a Title we know the outer Section | ||
// doesn't have a title (or it's wildly [and incorrectly] out of order) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: not related to whats going on in this function, but this comment got me thinking about error handling for components in easy ui that require some ordering or to be structured in some way. i haven't seen how other libraries deal with it, if it all, but i did some minor handling in the search nav and at the time it made sense for me to do it, but i wonder what the best practices are for these kinds of things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true. it's a good question. i think some libraries handle this situation with "slots", which i think i've seen comes with some error handling, but i'll do some research for future iterations
* @param deepFindFn Comparator function to test each child against | ||
* @returns The first child that meets the criteria of the comparator function | ||
*/ | ||
export function deepFind( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: i like this utility here
/** | ||
* Id to assign to the HTML element. | ||
*/ | ||
id?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: i might be missing something super obvious, but is this meant to be spread onto the element?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol yes. good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!
π Changes
<FormLayout />
componentβ Checklist