TextField.setValue doesn't change the value.
See original GitHub issueSetting “” (empty string) on the lastName
TextField
in shortcut scope example doesn’t work. It works only when the focus is on the firstName
TextField
, and might work when playing around with focus.
public class Scope extends Div {
public Scope() {
TextField firstName = new TextField();
TextField lastName = new TextField();
add(firstName, lastName);
Command command = () -> {
firstName.setValue("");
lastName.setValue("");
firstName.focus();
};
// first parameter is the lifecycle owner of the shortcut and
// will be discussed later.
Shortcuts.addShortcutListener(this, command, Key.ESCAPE)
// defines the component onto which the shortcuts listener
// is attached:
.listenOn(this);
}
}
When fixing this improve also the documentation and also type and field naming in the example.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Material-UI TextField is not updating value when using ...
I'm trying to set new value that I'm getting from props and than update the TextField component with setValue of react-hook-form library.
Read more >useForm - setValue - React Hook Form
This function allows you to dynamically set the value of a registered field and have the options to validate and update the form...
Read more >setValue in the reactive form does not trigger change event in ...
Replication procedure: 1. Run the attached sample. 2. Open the browser console. 3. Change the value using up and down arrow keys ......
Read more >API Documentation - Simple React forms validation
By using a custom register call, you will need to update the input value with setValue , because input is no longer registered...
Read more >FormControl setvalue doesn't trigger valueChanges ... - Reddit
So I have a reactive form control which is passed as input to the child ... Updating the form control value doesn't change...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I pretty sure this is what happens:
Please don’t tell me it is a feature 🤓
There’s a separate ticket for the assumed root cause. https://github.com/vaadin/flow/issues/7046.