-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Display red border around styled inputs when there are errors #9942
base: main
Are you sure you want to change the base?
Conversation
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.
PR Summary
This PR implements error state styling for input fields by utilizing the hasError
prop to display a red border around invalid inputs.
- Modified
packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/MultiItemBaseInput.tsx
to use theme-based danger color for border whenhasError
is true - Potential issue: Error styling only applies when
hasItem
is true, which may not show validation errors in empty states - Consider extending error state styling to all input states, not just when
hasItem
is true
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
${({ hasError, hasItem, theme }) => | ||
hasItem && | ||
css` | ||
background-color: ${theme.background.transparent.lighter}; | ||
border-radius: 4px; | ||
border: 1px solid ${theme.border.color.medium}; | ||
border: 1px solid ${hasError ? theme.border.color.danger : theme.border.color.medium}; | ||
`} |
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.
logic: Error styling only applies when hasItem is true. Consider if error state should be visible regardless of hasItem status.
Hi @khuddite, thank you for your PR ! Checked out on your branch, I notice this red border that we don't want, when inputing first item. |
@etiennejouan Thanks for your review. If I understand correctly, the issue is that an unnecessary grey border is displayed around the red border. Correct? |
Fixes #9778
Summary
hasError
prop was simply ignored inStyledInput
when it should have been used to flag the text input as invalid by displaying a red border around it.Screenshot
with action items -
without action items -