Foreign Key fixes:

1. Auto FK related fixes.
2. Properties tab not showing columns.
3. Toggle button is editable even if set to read-only.
4. Dropdown placeholder should be blank for read-only/disabled.
5. Input control help text color on a dark theme.

Fixes #6770
This commit is contained in:
Aditya Toshniwal
2021-09-22 18:18:09 +05:30
committed by Akshay Joshi
parent fc86faf51e
commit a8c8ea69e3
13 changed files with 29 additions and 195 deletions

View File

@@ -511,7 +511,7 @@ export function InputToggle({cid, value, onChange, options, disabled, readonly,
{
(options||[]).map((option)=>{
const isSelected = option.value === value;
const isDisabled = disabled || (readonly && isSelected);
const isDisabled = disabled || (readonly && !isSelected);
return (
<ToggleButton key={option.label} value={option.value} component={isSelected ? PrimaryButton : DefaultButton}
disabled={isDisabled} aria-label={option.label}>
@@ -766,7 +766,7 @@ export function InputSelect({
menuPortalTarget: document.body,
styles: styles,
inputId: cid,
placeholder: controlProps.placeholder || gettext('Select...'),
placeholder: (readonly || disabled) ? '' : controlProps.placeholder || gettext('Select...'),
...otherProps,
...props
};