You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you make a handler on itemChange, it is called after valueChange, although we first select the value from items, and only then we change based on that value.
Current behavior: valueChange -> itemChange
Expected behavior: itemChange -> valueChange
What's the problem: when processing values, valueChange always goes according to the previous value of itemChange, not the current value. Since valueChange is the main event, the main processing is done on it.
I have to insert crutches, because it is not very logical to transfer everything to itemChange, because itemChange event, as I understood, should refer to the selection of an item in the list range
onValueChange(value: TuiDayRange|null){// Hard workaround to sync eventstimer(0).pipe(takeUntilDestroyed(this.destroyRef)).subscribe(()=>{this.rangeChange.emit({dateFrom: value?.from.toJSON(),dateTo: value?.to.toJSON(),presetValue: this.selectedItemFromItemChange(),});});}
In stack blitz showed example "By changing the value, the filter is closed and the value is mapped to the outside of the component
When item is changed, the value is written to the signal to save the selected period."
The problem is that the value always goes with the old item in the valueChange handler.
Taiga UI version
33.89.0
Browser Used
Chrome
OS Used
macOS
The text was updated successfully, but these errors were encountered:
0ReC0
changed the title
🐞 - tui-calendar-range, emitter itemChange not calling before valueChange, also cant get access to 'name' field of TuiDayRangePeriod
🐞 - tui-calendar-range, emitter itemChange not calling before valueChange
Dec 2, 2024
Reproduction url
https://stackblitz.com/edit/angular-uqjw4d?file=src%2Fapp%2Fcalendar%2Fcalendar.component.ts
Description
1. Problem
If you make a handler on itemChange, it is called after valueChange, although we first select the value from items, and only then we change based on that value.
Current behavior: valueChange -> itemChange
Expected behavior: itemChange -> valueChange
What's the problem: when processing values, valueChange always goes according to the previous value of itemChange, not the current value. Since valueChange is the main event, the main processing is done on it.
I have to insert crutches, because it is not very logical to transfer everything to itemChange, because itemChange event, as I understood, should refer to the selection of an item in the list range
In stack blitz showed example "By changing the value, the filter is closed and the value is mapped to the outside of the component
When item is changed, the value is written to the signal to save the selected period."
The problem is that the value always goes with the old item in the valueChange handler.
Taiga UI version
33.89.0
Browser Used
Chrome
OS Used
macOS
The text was updated successfully, but these errors were encountered: