1
Fork 0

work around event.relatedTarget not being available sometimes

This commit is contained in:
Conduitry 2022-07-24 08:54:40 -04:00
parent 1e5699ef92
commit 77f9154048

View file

@ -21,8 +21,8 @@ export const field = (validator, chill) => {
};
const action = (node) => {
const on_blur = (event) => {
if (!node.contains(event.relatedTarget)) {
const on_blur = async (event) => {
if (!node.contains(event.relatedTarget || await new Promise((res) => setTimeout(() => res(document.activeElement), 100)))) {
validate();
}
};