This method updates the eddited value to that of the input in the HTMLTextAreaElement
.
This is an onblur event listener . In order to trigger the input's onchange.
xxxxxxxxxx
public update_textarea_input(textarea:HTMLTextAreaElement) {
Input is the entered data in the text area. whisch is the child of the parent of the text area.
xxxxxxxxxx
const input = textarea.parentElement!.querySelector("input")!;
Transfer the text area content to the input value else ignore the transfer if there are no changes..
xxxxxxxxxx
if (
textarea.textContent === null
|| input.value === textarea.textContent
) return;
Commit/save the changes
xxxxxxxxxx
input.value = textarea.textContent;
Mark the cell as editted .
xxxxxxxxxx
input.parentElement!.classList.add('edited');
}