-
-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Reprosteps
- Handle EditContext.OnFieldChanged event
- Click on a date in the calendar.
- EditContext.OnFieldChanged event handler is called twice
Why?
(both HxInputDate<TValue> and also HxInputDateInternal<TValue> inherit from InputBase<TValue>)
First call
- HxInputDateInternal<TValue>.HandleValueChanged is called.
- HxInputDateInternal<TValue>.HandleValueChanged sets the CurrentValueAsString.
- CurrentValueAsString setter sets InputBase<TValuegt;.CurrentValue.
- InputBase<TValue>.CurrentValue calls ValueChanged (important to understand the the second call)
- The InputBase<TValue>.CurrentValue setter calls EditContext.NotifyFieldChanged for the first time.
Second call
- HxInputDate<Value> handles ValueChanged event
- It sets the CurrentValue property (see BuildRenderInputCore method, sequence number 101).
- The InputBase<TValue>.CurrentValue setter calls (again) EditContext.NotifyFieldChanged.
Posible solutions (not sure right now)
- only HxInputDate<TValue> should derive from InputBase<TValue>
- OR HxInputDate<TValue> should not Set CurrentValue, but it should fire ValueChanged event
(I guess this occurs also in HxInputDateRange while it uses the same code structure.)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working