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

861 - The component does not have a red border #862

Merged
merged 3 commits into from
Oct 16, 2024
Merged

861 - The component does not have a red border #862

merged 3 commits into from
Oct 16, 2024

Conversation

zDudaHang
Copy link
Contributor

closes #861

Copy link
Member

@wesleydecezere wesleydecezere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@@ -13,7 +13,7 @@ export function MonthRangePickerInput(props: MonthRangePickerInputProps) {

return (
<FormControl {...getFormControlProps()}>
<BaseMonthRangeInput {...inputProps} {...rest} />
<BaseMonthRangeInput invalid={inputProps['aria-invalid']} {...inputProps} {...rest} />
Copy link
Member

@wesleydecezere wesleydecezere Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the aria-invalid property need to remain in inputProps, since it has already been used elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a hook's result and this hook is used everywhere, so i think it's not a good idea to remove from useFormControl

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I meant to just stop passing it to the BaseMonthRangeInput component, since it's already being passed to the invalid prop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, now i understand hehe

export const MinMax = () => {
const [range, setRange] = useState<ReferenceMonthRange>(initialValue)

const handleChange = (dateRange: DateRange) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const handleChange = (dateRange: DateRange) => {
const handleRangeChange = (setRange) => (dateRange: DateRange) => {

You could declare this function at the file scope and reuse it within the component scope

wesleydecezere
wesleydecezere previously approved these changes Oct 14, 2024
@zDudaHang zDudaHang removed the request for review from wagnerbsantos October 15, 2024 12:19
@@ -13,7 +13,7 @@ export function MonthRangePickerInput(props: MonthRangePickerInputProps) {

return (
<FormControl {...getFormControlProps()}>
<BaseMonthRangeInput {...inputProps} {...rest} />
<BaseMonthRangeInput invalid={inputProps['aria-invalid']} {...inputProps} {...rest} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I meant to just stop passing it to the BaseMonthRangeInput component, since it's already being passed to the invalid prop.

@fabmatos fabmatos merged commit b6664a0 into main Oct 16, 2024
1 of 2 checks passed
@fabmatos fabmatos deleted the 861 branch October 16, 2024 18:06
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

Successfully merging this pull request may close these issues.

[MonthRangePicker] The component does not have a red border
3 participants