-
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
Input error passing label prop on false #505
Conversation
…hub.com/LaunchPadLab/lp-components into input-error-passing-label-prop-on-false
src/tables/components/table-row.js
Outdated
const DefaultCellComponent = ({ className, onClick, placeholder, value, ...rest }) => // eslint-disable-line | ||
<td { ...{ className, onClick, ...filterInvalidDOMProps(rest) }}>{ isNil(value) ? placeholder : value }</td> |
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.
I imagine you might have branched off of expanded-props-cell
when you made this change? Please remove
src/forms/labels/input-label.js
Outdated
return ( | ||
<span> | ||
{ | ||
label !== false && | ||
<label htmlFor={ id || name } className={ className }> | ||
<label htmlFor={ id || name } className={ className } {...filterInvalidDOMProps(rest)}> |
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.
Is this tied to a specific issue?
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.
Ah I see, looks like this is related to #506. Can you revert these changes from this PR?
.add('with custom properties on cell component per column', () => ( | ||
<SortableTable data={tableData}> | ||
<Column name="name" customCellClass="test" /> | ||
<Column name="age" data-cy="age"/> | ||
<Column name="active" aria-label="Active" /> | ||
</SortableTable> | ||
)) |
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.
Same comment as above re: keeping your PR changes isolated
return hasInputError({ touched, invalid }) | ||
? <span | ||
id={ generateInputErrorId(name) } | ||
className={ classnames('error-message', className) } | ||
{ ...filterInvalidDOMProps(rest) } | ||
{ ...filterInvalidDOMProps(!label ? omit(rest, 'label') : rest) } |
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.
You're already omitting label
from rest
on line 74, so you shouldn't need this?
@aojin Do you have bandwidth to make these changes or would it be better to reassign? |
Turns out this was actually fixed in #380. Since this task is now getting included in the v7 milestone, I'm going to mark this as closed. |
Omit label props before passing them to default InputError component #471