-fix WI entry 2ndary key height

-initHeight and resetHeight functions moved from WI to utils
This commit is contained in:
RossAscends
2023-05-06 21:28:24 +09:00
parent 1cc3d0ac9f
commit f1f150e5d1
3 changed files with 25 additions and 16 deletions

View File

@ -161,4 +161,18 @@ export function restoreCaretPosition(element, position) {
const selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
}
export async function resetScrollHeight(element) {
element.style.height = '';
element.style.height = (element.scrollHeight) + 3 + 'px';
}
export async function initScrollHeight(element) {
await delay(1);
const height = Number($(element).prop("scrollHeight") + 3);
console.log(`init height to ${height}`);
//console.log(element.style.height);
$(element).css("height", "");
$(element).css("height", `${height}px`);
}