Last active
October 23, 2019 05:21
-
-
Save thanapongp/77e107a42d551b7969771d886fd63534 to your computer and use it in GitHub Desktop.
performEdit method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
editItem(item, oldItemName) { | |
const editInput = htmlToElement(` | |
<input type="text" value="${oldItemName}" placeholder="Enter new item name" class="bg-gray-800 px-4 py-2 rounded block w-full text-gray-200 font-light"> | |
`); | |
editInput.addEventListener('keyup', e => { | |
if (e.keyCode === 13) { | |
this.performEdit(item, editInput) | |
} | |
}); | |
} | |
performEdit(item, editInput) { | |
console.log(editInput.value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment