Skip to content

Commit

Permalink
chore: apply code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
vursen committed Mar 18, 2022
1 parent 85779eb commit bc0dccb
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ public DateTimePicker(LocalDateTime initialDateTime) {
setPresentationValue(initialDateTime);
synchronizeChildComponentValues(initialDateTime);
} else if (this.getElement().getProperty("value") == null) {
// Only apply initial value if the element does not already have a value,
// Applying `null` forces the client side `value` property to have an empty string.
// Having an empty string prevents `ValueChangeEvent` which otherwise can be triggered
// as a result of Polymer converting `null` to an empty string by itself.
// Only apply `null` if the element does not already have a value,
// which can be the case when binding to an existing element from a Lit
// template.
setPresentationValue(null);
Expand Down

0 comments on commit bc0dccb

Please sign in to comment.