Skip to content

Commit 0fa97f8

Browse files
committed
input char counter red color only when focused
1 parent 05ca7f7 commit 0fa97f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/inputs/TextInput.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,11 @@ export default class TextInput extends BaseInput {
278278
}
279279

280280
renderCharCounter() {
281+
const {focused} = this.state;
281282
const {maxLength, showCharacterCounter} = this.props;
282283
if (maxLength && showCharacterCounter) {
283284
const counter = this.getCharCount();
284-
const color = this.isCounterLimit() ? charCountColorLimit : charCountColorDefault;
285+
const color = this.isCounterLimit() && focused ? charCountColorLimit : charCountColorDefault;
285286
return (
286287
<Text
287288
style={[{color}, this.styles.charCounter]}

0 commit comments

Comments
 (0)