fix(ui): capture tabs in the editor

This commit is contained in:
Himadri Bhattacharjee
2025-12-01 15:37:30 +05:30
parent 919a9092b6
commit 6e20e7e61e

View File

@@ -18,6 +18,21 @@ function doApi(message) {
body: JSON.stringify(message)
})
}
editor.addEventListener("keydown", (e) => {
if (e.keyCode === 9) {
e.preventDefault();
editor.setRangeText(
" ",
editor.selectionStart,
editor.selectionStart,
"end"
);
}
});
editor.addEventListener('keyup', (_) => {
clearTimeout(timer);
timer = setTimeout(() => {