Skip to content

Commit ce6193b

Browse files
authored
Reset day selection on mouse leaving chart (#8285)
1 parent 4ebac35 commit ce6193b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/web_app/lib/src/widget/weekly_sparkline/widget.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,15 @@ void drawChart(Element svg, HTMLDivElement toolTip, HTMLDivElement chartSubText,
162162
lastSelectedDay = selectedDay.date;
163163
});
164164

165-
void erase(_) {
165+
void hideSparklineCursor(_) {
166166
sparklineCursor.setAttribute('style', 'opacity:0');
167167
toolTip.setAttribute('style', 'opacity:0;position:absolute;');
168-
169168
chartSubText.text = '${formatDate(firstDay)} - ${formatDate(lastDate)}';
169+
lastSelectedDay = null;
170170
}
171171

172-
erase(1);
173-
chart.onMouseLeave.listen(erase);
172+
hideSparklineCursor(1);
173+
chart.onMouseLeave.listen(hideSparklineCursor);
174174
}
175175

176176
int lowerBoundBy<E, K>(List<E> sortedList, K Function(E element) keyOf,

0 commit comments

Comments
 (0)