I created a simple drag and drop system, the elements I added are normally deleted when I click the “X” text, but when I apply drag and drop events to this element and put it into another container, that element can no longer be deleted, you can check my codepen account to try. I’ll put a short code block below, but it’s all in the codepen
Codepen: https://codepen.io/BerkayAkgurgen/pen/dyOZezE
function dragOver() {
boxs.forEach(container => {
container.addEventListener('dragover', function (e) {
const draggable = document.querySelector('.draggable')
container.appendChild(draggable)
e.preventDefault()
})
})
}
function removeLocalItem(value) {
let storageElement = getLocalStorage()
storageElement = storageElement.filter(function (item) {
if (item.name !== value) {
return item
}
})
localStorage.setItem('Item', JSON.stringify(storageElement))
}