prevent setting item parent to itself

This commit is contained in:
Anton Tranelis 2024-07-31 19:13:27 +02:00
parent ca86bad272
commit 93ba730c94

View File

@ -36,7 +36,7 @@ function useSelectPositionManager(): {
useEffect(() => {
if (selectPosition && markerClicked && 'text' in selectPosition) {
if (selectPosition && markerClicked && 'text' in selectPosition && markerClicked.id !==selectPosition.id) {
itemUpdateParent({ ...selectPosition, parent: markerClicked.id })
}
}, [markerClicked])