There is an existing bug in the TextField event listener in SimpletimerDemo.java, where invalid input is not properly handled. This issue was preserved in the recent refactor in PR #37.
PR: #37
Comment: #37 (comment)
The bug can be fixed by ensuring that the input value is a valid number before updating the time field. Here is a suggested fix:
new TextField("Start Time", e -> {
try {
time = new BigDecimal(e.getValue());
} catch (NumberFormatException ex) {
Notification.show("Invalid input. Please enter a valid number.");
return;
}
update();
});
This issue needs to be addressed to improve the robustness of the application.