Highlight bad input regions

If an invalid region is inputted,
make it red.
This commit is contained in:
Emilia Allison 2023-05-22 14:07:50 -04:00
parent c3270d3c59
commit 00f39e636a
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
2 changed files with 9 additions and 2 deletions

View File

@ -33,6 +33,9 @@ div.transfer_menu {
height: 100%;
border: 2px solid orange;
}
div.transfer_menu input:invalid {
background-color: #faa;
}
div.plate_container {
border: 2px dashed purple;

View File

@ -29,7 +29,9 @@ pub fn TransferMenu() -> Html {
interleave_x: state.interleave_x,
interleave_y: state.interleave_y
});
log::debug!("{:?}", dispatch.get());
input.set_custom_validity("");
} else {
input.set_custom_validity("Invalid region.")
}
}
})
@ -50,7 +52,9 @@ pub fn TransferMenu() -> Html {
interleave_x: state.interleave_x,
interleave_y: state.interleave_y
});
log::debug!("{:?}", dispatch.get());
input.set_custom_validity("");
} else {
input.set_custom_validity("Invalid region.")
}
}
})