mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
fix(content-manager): add optional chaining because listRef may not have a node attached (#18093)
This commit is contained in:
parent
36b8dc9438
commit
a472dbc410
@ -196,13 +196,13 @@ const RelationInput = ({
|
||||
updatedRelationsWith.current === 'onChange' &&
|
||||
relations.length !== previewRelationsLength
|
||||
) {
|
||||
listRef.current.scrollToItem(relations.length, 'end');
|
||||
listRef.current?.scrollToItem(relations.length, 'end');
|
||||
updatedRelationsWith.current = undefined;
|
||||
} else if (
|
||||
updatedRelationsWith.current === 'loadMore' &&
|
||||
relations.length !== previewRelationsLength
|
||||
) {
|
||||
listRef.current.scrollToItem(0, 'start');
|
||||
listRef.current?.scrollToItem(0, 'start');
|
||||
updatedRelationsWith.current = undefined;
|
||||
}
|
||||
}, [previewRelationsLength, relations]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user