vaadin / vaadin/framework

Unexpected value change event in DateField with MONTH resolution

Open
#11,729 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Stale
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.