handleSubmitted method
Handles the value submitted event.
This method calls the onSubmitted callback with the provided newValue
and then calls handleUpdateUI.
Implementation
void handleSubmitted(String newValue) {
onSubmitted?.call(newValue);
handleUpdateUI();
}