Unexpected value change event in DateField with MONTH resolution
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
The following code fires a value change event in Vaadin 8.9.0, while it didn't fire it in Vaadin 8.8.6.
DateField df = new DateField();
df.setResolution(DateResolution.MONTH);
df.setValue(LocalDate.now());
df.addValueChangeListener(ev->{
System.out.println("OLD:"+ev.getOldValue()+" NEW:"+ev.getValue());
});
The question is whether this is a regression, or it is valid to fire an event in this scenario
(since the value is "rounded" to the first day of month, thus it's different from the value that has been set) or it isn't valid (because the resolution was known when the value was initially set)
Actual behavior: a value change event is fired
Expected behavior: ?
(Browser version: Chrome)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the provided DateField example with DateResolution.MONTH on Vaadin 8.8.6 and 8.9.0, recording whether the listener fires and the old and new values. Then trace DateField's value and resolution handling to determine the intended behavior. Done means the expected event semantics are documented and, if a regression is confirmed, covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100