fix(ui): use isValidDrop in imageDropped listener

It was possible for a drop event to be invalid but still processed. Fixed by slightly changing the signature of isValidDrop.
This commit is contained in:
psychedelicious
2024-05-31 17:37:30 +10:00
parent 8f8ddd620b
commit 4ef8cbd9d0
4 changed files with 20 additions and 12 deletions

View File

@ -36,7 +36,7 @@ const IAIDroppable = (props: IAIDroppableProps) => {
pointerEvents={active ? 'auto' : 'none'}
>
<AnimatePresence>
{isValidDrop(data, active) && <IAIDropOverlay isOver={isOver} label={dropLabel} />}
{isValidDrop(data, active?.data.current) && <IAIDropOverlay isOver={isOver} label={dropLabel} />}
</AnimatePresence>
</Box>
);