Commit 0a4c2e0
committed
don't raise SelectionChanged during parent-child synchronization
If a previously valid DateTime was selected (e.g. Jan 1 2019, 12:00AM), when
we change the DateTime interval (e.g. Jan 1 2020, 1:00AM - Dec 31 2020, 11:59PM)
to exclude the selection, Date selection is cleared but Time selection is not
cleared (remains 12:00AM) instead having TimePicker disabled.
When we make a new valid selection on Date (e.g. Jan 1 2020), since previously
selected Time (12:00AM) no longer falls within the interval (1:00AM - 11:59PM),
TimePicker, once received the updated interval, will clear the selected Time.
But between DateTimePicker updates Date selection and the updated interval
reaches TimePicker, there's a transient state of DateTimePicker
(Jan 1 2020, 12:00AM) that doesn't fall within the specified interval and thus
an incorrect value is raised through SelectionChanged.
We add isWithinInterval predicate and raiseSelectionChanged handler to prevent
this from happening.1 parent 4b2da64 commit 0a4c2e0
1 file changed
+31
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
110 | | - | |
111 | | - | |
| 111 | + | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | | - | |
117 | | - | |
| 117 | + | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
150 | 177 | | |
151 | 178 | | |
152 | 179 | | |
| |||
0 commit comments