I'm writing a Trello, I ran into a problem that a card is not being created. The logic should be the following. On clicking the button, a modal opens. There they receive data and send it to an array in localStorega. Then they get data from the storage and update the boards and the card should appear. The data is sent to the array, but as I understand it, they do not find a place to create a card. All button creation functions are in main.js
const createBoardCard = index => {
const createCardBtn = document.querySelector('.create__card__btn')
const closeModalCardBtn = document.querySelector('.modalCard__close__btn')
showCardModal()
function handleCreateButtonClick() {
let cardName = cardTitle.value
let cardDiscription = cardText.value
let cardTagValue = cardTag.value
cardArr.push(new cardAdd(cardName, cardDiscription, cardTagValue))
fillCard()
addLocal()
closeCardModal()
createCardBtn.removeEventListener('click', handleCreateButtonClick)
}
createCardBtn.addEventListener('click', handleCreateButtonClick)
closeModalCardBtn.addEventListener("click", () => {
closeCardModal()
createCardBtn.removeEventListener('click', handleCreateButtonClick)
})
}
const fillCard = () => {
cardZone.innerHTML = ''
if (cardArr.length > 0) {
cardArr.forEach((item) => {
cardZone.innerHTML += createCard(item)
})
}
}