Skip to content

Commit

Permalink
Fix scaling issue with multi-line FormFieldValidationMessage (#1537)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandongregoryscott committed Oct 25, 2022
1 parent 957160f commit 83ad4ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/form-field/src/FormFieldValidationMessage.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import React, { memo, forwardRef } from 'react'
import { ErrorIcon } from '../../icons'
import { Pane } from '../../layers'
import { majorScale } from '../../scales'
import { Paragraph } from '../../typography'

const FormFieldValidationMessage = memo(
forwardRef(function FormFieldValidationMessage({ children, ...props }, ref) {
return (
<Pane ref={ref} display="flex" {...props}>
<ErrorIcon color="danger" marginTop={1} size={14} marginRight={8} />
<Pane display="flex" marginRight={majorScale(1)}>
<ErrorIcon color="danger" marginTop={1} size={14} />
</Pane>
<Paragraph marginTop={0} size={300} color="danger" role="alert">
{children}
</Paragraph>
Expand Down
6 changes: 6 additions & 0 deletions src/form-field/stories/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,11 @@ storiesOf('form-field', module)
document.body.style.height = '100vh'
})()}
<FormFieldValidationMessage>FormFieldValidationMessage</FormFieldValidationMessage>
<Box width={240}>
<FormFieldValidationMessage>
greatly nearby muscle evening picture took afraid fallen reason flight shout crew research act beneath flow
away cloth will pair world trip reach explain
</FormFieldValidationMessage>
</Box>
</Box>
))

0 comments on commit 83ad4ff

Please sign in to comment.