feat: add outlineColor prop in TextInputOutlined#2475
feat: add outlineColor prop in TextInputOutlined#2475lukewalczak merged 9 commits intocallstack:mainfrom
Conversation
|
Hello 👋, this pull request has been open for more than 2 months with no activity on it. If you think this is still necessary with the latest version, please comment and ping a maintainer to get this reviewed, otherwise it will be closed automatically in 7 days. |
|
@Trancever any chance to merge this? |
|
I'm not convinced in introducing the additional prop since you can customize the active/inactive color by passing the specific one via theme prop, e.g.: |
Hi @lukewalczak, thanks for your reply! With theme also changes placeholder and label color, check this demo My PR has the same behavior as underlineColor prop |
| hasActiveOutline={hasActiveOutline} | ||
| activeColor={activeColor} | ||
| outlineColor={outlineColor} | ||
| outlineColor={outlineColor || defaultOutlineColor} |
There was a problem hiding this comment.
Actually with that condition there won't be any difference between disabled and enabled state, since outlineColor will be always defined if passed by user.
Current behavior
| enabled | disabled |
|---|---|
![]() |
![]() |
outlineColor prop passed
| enabled | disabled |
|---|---|
![]() |
![]() |
Please correct it to have the visual feedback between those two states.
lukewalczak
left a comment
There was a problem hiding this comment.
Left one issue which has to be solved before merge.
@ahce thanks for specifying more details! I see the reason for that PR and would like to merge, however there is one issue, which has to be fixed before. |
| placeholderColor = outlineColor = colors.disabled; | ||
| placeholderColor = colors.disabled; | ||
| customOutlineColor = | ||
| outlineColor === 'transparent' ? outlineColor : colors.disabled; |
There was a problem hiding this comment.
I guess the reason for that check is to have transparent outline when input is disabled, but the way you handle it is incorrect. User can specify the color in various ways using hex or rgb format as well. To check if the passed outlineColor is transparent, please introduce the variable:
const isTransparent = color(customOutlineColor).alpha() === 0
then:
outlineColor = isTransparent ? customOutlineColor : placeholderColor;
| selectionColor, | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| underlineColor, | ||
| outlineColor, |
There was a problem hiding this comment.
| outlineColor, | |
| outlineColor: customOutlineColor, |
| let inputTextColor, activeColor, outlineColor, placeholderColor, errorColor; | ||
| let inputTextColor, | ||
| activeColor, | ||
| customOutlineColor, |
There was a problem hiding this comment.
| customOutlineColor, | |
| outlineColor, |
| activeColor = error ? colors.error : colors.primary; | ||
| placeholderColor = outlineColor = colors.placeholder; | ||
| placeholderColor = colors.placeholder; | ||
| customOutlineColor = outlineColor || colors.placeholder; |
There was a problem hiding this comment.
| customOutlineColor = outlineColor || colors.placeholder; | |
| outlineColor = customOutlineColor || placeholderColor; |
| hasActiveOutline={hasActiveOutline} | ||
| activeColor={activeColor} | ||
| outlineColor={outlineColor} | ||
| outlineColor={customOutlineColor} |
There was a problem hiding this comment.
| outlineColor={customOutlineColor} | |
| outlineColor={outlineColor} |




Motivation
Allows to controls the outline color.
Test plan
Demo