Skip to content

Commit

Permalink
fix: adjust textfield character counter position
Browse files Browse the repository at this point in the history
  • Loading branch information
KarineBrandelli committed May 3, 2024
1 parent 0b16e46 commit b9661bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flipper-ui",
"version": "0.31.5",
"version": "0.31.6",
"description": "",
"main": "dist/index.js",
"homepage": "https://flipper-ui.ngi.com.br/",
Expand Down
12 changes: 6 additions & 6 deletions src/core/inputs/text-field/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ export const TextField = ({
? classes.outlinedMultiline
: ''
},
endAdornment: characters && (
<CharactersCount>
{otherProps.value?.toString().length}/
{otherProps.inputProps?.maxLength}
</CharactersCount>
),
...InputProps
}}
SelectProps={{
Expand All @@ -319,12 +325,6 @@ export const TextField = ({
{...otherProps}>
{options ? renderOptions(options, classes) : children}
</MuiTextField>
{characters && (
<CharactersCount>
{otherProps.value?.toString().length}/
{otherProps.inputProps?.maxLength}
</CharactersCount>
)}
{onHelperClick && (
<HelperBox
helperIcon={helperIcon}
Expand Down
5 changes: 2 additions & 3 deletions src/core/inputs/text-field/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export const Helper = styled.div`
`

export const TextFieldWrapper = styled.div`
width: 100%;
display: flex;
flex-direction: rows;
width: 100%;
align-items: center;
button {
display: none;
Expand All @@ -24,14 +24,13 @@ export const TextFieldWrapper = styled.div`
`

export const StaticTextFieldWrapper = styled.div`
width: 100%;
display: flex;
flex-direction: rows;
width: 100%;
align-items: center;
`

export const CharactersCount = styled.span`
margin-left: -35px;
color: ${grays.g3};
font-size: 14px;
font-family:
Expand Down

0 comments on commit b9661bc

Please sign in to comment.