Skip to content

Commit

Permalink
fix: fully disable inputs when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
nickofthyme committed Jan 11, 2025
1 parent 9959b18 commit 4ffca69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export const euiFieldTextStyles = (euiThemeContext: UseEuiTheme) => {
${formStyles.focus}
}
&:disabled {
${formStyles.disabled}
}
&[readOnly] {
${formStyles.readOnly}
}
&:disabled {
${formStyles.disabled}
}
&:autofill {
${formStyles.autoFill}
}
Expand Down
6 changes: 4 additions & 2 deletions packages/eui/src/components/form/field_text/field_text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export const EuiFieldText: FunctionComponent<EuiFieldTextProps> = (props) => {
compressed,
prepend,
append,
readOnly,
disabled,
readOnly = disabled, // sync to prevent onChange unless explicitly defined
controlOnly,
...rest
} = props;
Expand Down Expand Up @@ -103,6 +104,7 @@ export const EuiFieldText: FunctionComponent<EuiFieldTextProps> = (props) => {
css={cssStyles}
value={value}
ref={inputRef}
disabled={disabled}
readOnly={readOnly}
{...rest}
/>
Expand All @@ -117,8 +119,8 @@ export const EuiFieldText: FunctionComponent<EuiFieldTextProps> = (props) => {
fullWidth={fullWidth}
isLoading={isLoading}
isInvalid={isInvalid}
isDisabled={rest.disabled}
compressed={compressed}
isDisabled={disabled}
readOnly={readOnly}
prepend={prepend}
append={append}
Expand Down

0 comments on commit 4ffca69

Please sign in to comment.