mirror of
https://github.com/strapi/strapi.git
synced 2025-11-10 07:10:11 +00:00
Merge pull request #5341 from strapi/fix/polymorphic-relation-ctm
Fix polymorphic relations in the content manager
This commit is contained in:
commit
e397855a67
@ -24,6 +24,8 @@ function SelectWrapper({
|
|||||||
placeholder,
|
placeholder,
|
||||||
}) {
|
}) {
|
||||||
const { pathname, search } = useLocation();
|
const { pathname, search } = useLocation();
|
||||||
|
// Disable the input in case of a polymorphic relation
|
||||||
|
const isMorph = relationType.toLowerCase().includes('morph');
|
||||||
const {
|
const {
|
||||||
addRelation,
|
addRelation,
|
||||||
modifiedData,
|
modifiedData,
|
||||||
@ -49,6 +51,12 @@ function SelectWrapper({
|
|||||||
startRef.current = state._start;
|
startRef.current = state._start;
|
||||||
|
|
||||||
ref.current = async () => {
|
ref.current = async () => {
|
||||||
|
if (isMorph) {
|
||||||
|
setIsLoading(false);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isDraggingComponent) {
|
if (!isDraggingComponent) {
|
||||||
try {
|
try {
|
||||||
const params = cloneDeep(state);
|
const params = cloneDeep(state);
|
||||||
@ -189,7 +197,7 @@ function SelectWrapper({
|
|||||||
addRelation({ target: { name, value } });
|
addRelation({ target: { name, value } });
|
||||||
}}
|
}}
|
||||||
id={name}
|
id={name}
|
||||||
isDisabled={!editable}
|
isDisabled={!editable || isMorph}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
isClearable
|
isClearable
|
||||||
mainField={mainField}
|
mainField={mainField}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user