Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change field style colors when input is not editable #25991

Merged
2 changes: 2 additions & 0 deletions src/components/TextInput/BaseTextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ function BaseTextInput(props) {

// Stop scrollbar flashing when breaking lines with autoGrowHeight enabled.
props.autoGrowHeight && StyleUtils.getAutoGrowHeightInputStyle(textInputHeight, maxHeight),
// Add disabled color theme when field is not editable.
props.disabled && styles.textInputDisabled,
]}
multiline={isMultiline}
maxLength={props.maxLength}
Expand Down
16 changes: 16 additions & 0 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,22 @@ const styles = {
borderColor: themeColors.danger,
},

textInputDisabled: {
// Adding disabled color theme to indicate user that the field is not editable.
backgroundColor: themeColors.highlightBG,
borderBottomWidth: 2,
borderColor: themeColors.borderLighter,
// Adding browser specefic style to bring consistency between Safari and other platforms.
// Applying the Webkit styles only to browsers as it is not available in native.
...(Browser.getBrowser()
? {
WebkitTextFillColor: themeColors.textSupporting,
WebkitOpacity: 1,
}
: {}),
color: themeColors.textSupporting,
},

uploadReceiptView: (isSmallScreenWidth) => ({
borderRadius: variables.componentBorderRadiusLarge,
borderWidth: isSmallScreenWidth ? 0 : 2,
Expand Down