Harbor

branch main
showing the latest snapshot on main
markdown-editor.js 290 B · JavaScript
public/js/markdown-editor.js 0644 Raw
const markdownInputs = document.querySelectorAll('[data-markdown-input]');

markdownInputs.forEach((input) => {
	function resizeInput() {
		input.style.height = 'auto';
		input.style.height = `${input.scrollHeight}px`;
	}

	input.addEventListener('input', resizeInput);
	resizeInput();
});