feat: handle input tags in getElementInfo

This commit is contained in:
amhsirak
2025-01-06 23:29:15 +05:30
parent 1ab4631da8
commit c86fdf8013

View File

@@ -182,7 +182,10 @@ export const getElementInformation = async (
...info.attributes,
selectedValue: selectElement.value,
};
} else {
} else if (targetElement?.tagName === 'INPUT' && (targetElement as HTMLInputElement).type === 'time' || (targetElement as HTMLInputElement).type === 'date') {
info.innerText = (targetElement as HTMLInputElement).value;
}
else {
info.hasOnlyText = targetElement.children.length === 0 &&
(targetElement.textContent !== null &&
targetElement.textContent.trim().length > 0);