File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
react/src/components/TextInput
styles/scss/components/text-input Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,8 @@ const TextInput = React.forwardRef(function TextInput(
114114 [ `${ prefix } --text-input-wrapper--readonly` ] : readOnly ,
115115 [ `${ prefix } --text-input-wrapper--light` ] : light ,
116116 [ `${ prefix } --text-input-wrapper--inline` ] : inline ,
117+ [ `${ prefix } --text-input-wrapper--inline--invalid` ] :
118+ inline && normalizedProps . invalid ,
117119 }
118120 ) ;
119121 const labelClasses = classNames ( `${ prefix } --label` , {
@@ -195,7 +197,7 @@ const TextInput = React.forwardRef(function TextInput(
195197 ) : (
196198 < div className = { `${ prefix } --text-input__label-helper-wrapper` } >
197199 { labelWrapper }
198- { ! isFluid && helper }
200+ { ! isFluid && ( normalizedProps . validation || helper ) }
199201 </ div >
200202 ) }
201203 < div className = { fieldOuterWrapperClasses } >
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ Playground.argTypes = {
132132 control : {
133133 type : 'text' ,
134134 } ,
135- defaultValue : 'Invalid text ' ,
135+ defaultValue : 'Error message goes here ' ,
136136 } ,
137137 disabled : {
138138 control : {
Original file line number Diff line number Diff line change 392392 flex-direction : column ;
393393 }
394394
395+ .#{$prefix } --text-input-wrapper--inline .cds--form-requirement {
396+ display : block ;
397+ overflow : visible ;
398+ max-height : rem (200px );
399+ font-weight : 400 ;
400+ }
401+
402+ .#{$prefix } --text-input-wrapper--inline--invalid .cds--form-requirement {
403+ color : $text-error ;
404+ }
405+
395406 // -----------------------------
396407 // Readonly
397408 // -----------------------------
You can’t perform that action at this time.
0 commit comments