-
Notifications
You must be signed in to change notification settings - Fork 841
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
FormControlLayout: Error if append prop is a string #2283
Comments
I think this will be fixed by #2167 , but I'll double-check when that PR is finalized |
Cool, thanks. I'm not sure whether this PR will fix it, it seems like the problem is that createSideNode(
node: ReactElement,
side: 'append' | 'prepend',
key: React.Key
) {
return cloneElement(node, {
className: `euiFormControlLayout__${side}`,
key: key,
});
} |
Ah it looks like |
Either that or having a separate branch in the code wrapping a naked |
It doesn't look like #2167 will address this issue: the type for append/prepend in EuiFormControlLayout is The issue is the |
If that fits on the roadmap it would be nice to go the other way and extend form control layout to support all of <EuiFieldText value={timeoutValue} append="ms" /> Nothing super important though. |
|
Passing in a string as
append
to anything building on top ofEuiFormControlLayout
(EuiFieldText
,EuiFieldNumber
, ...) is allowed by the typings, but throws an error during runtime because it's always treated as a React element (https://github.com/elastic/eui/blob/master/src/components/form/form_control_layout/form_control_layout.tsx#L154).The text was updated successfully, but these errors were encountered: