mirror of
https://github.com/mattermost/focalboard.git
synced 2025-01-02 14:47:55 +02:00
[GH-410] Remove background from read-only input fields (#452)
* [GH-410] Remove background from read-only input fields This makes the background of text input fields transparent when the field is read-only. Making it transparent will make the background show through which prevents giving the visual impression of being editable. Fixes #410 * Update snapshot
This commit is contained in:
parent
6bb987a233
commit
47b528b2f3
@ -56,7 +56,7 @@ exports[`components/content/CheckboxElement should match snapshot on read only 1
|
||||
value="off"
|
||||
/>
|
||||
<input
|
||||
class="Editable undefined"
|
||||
class="Editable readonly undefined"
|
||||
placeholder="Edit text..."
|
||||
readonly=""
|
||||
spellcheck="true"
|
||||
|
@ -17,4 +17,7 @@
|
||||
border: 1px solid var(--error-color);
|
||||
border-radius: var(--default-rad);
|
||||
}
|
||||
&.readonly {
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ const Editable = (props: Props, ref: React.Ref<{focus: (selectAll?: boolean) =>
|
||||
saveOnBlur.current = true
|
||||
}
|
||||
|
||||
const {value, onChange, className, placeholderText} = props
|
||||
const {value, onChange, className, placeholderText, readonly} = props
|
||||
let error = false
|
||||
if (props.validator) {
|
||||
error = !props.validator(value || '')
|
||||
@ -67,7 +67,7 @@ const Editable = (props: Props, ref: React.Ref<{focus: (selectAll?: boolean) =>
|
||||
return (
|
||||
<input
|
||||
ref={elementRef}
|
||||
className={'Editable ' + (error ? 'error ' : '') + className}
|
||||
className={'Editable ' + (error ? 'error ' : '') + (readonly ? 'readonly ' : '') + className}
|
||||
placeholder={placeholderText}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
onChange(e.target.value)
|
||||
@ -90,7 +90,7 @@ const Editable = (props: Props, ref: React.Ref<{focus: (selectAll?: boolean) =>
|
||||
blur()
|
||||
}
|
||||
}}
|
||||
readOnly={props.readonly}
|
||||
readOnly={readonly}
|
||||
spellCheck={props.spellCheck}
|
||||
/>
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user