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

Display red border around styled inputs when there are errors #9942

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

khuddite
Copy link
Contributor

@khuddite khuddite commented Jan 30, 2025

Fixes #9778

Summary

hasError prop was simply ignored in StyledInput when it should have been used to flag the text input as invalid by displaying a red border around it.

Screenshot

with action items -

CleanShot 2025-01-30 at 12 33 05

without action items -

CleanShot 2025-01-30 at 12 49 28

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 when hasError 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

Comment on lines 16 to 22
${({ 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};
`}
Copy link
Contributor

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.

@Devessier Devessier self-assigned this Jan 31, 2025
@Devessier Devessier removed their assignment Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No error when adding wrong link in record details
2 participants