calendar: Fix duplicate IDs cause click events not respond (#732)
This commit is contained in:
parent
8a3b858d1a
commit
f759cc5023
1 changed files with 3 additions and 5 deletions
|
|
@ -510,7 +510,6 @@ impl Calendar {
|
||||||
|
|
||||||
fn render_day(
|
fn render_day(
|
||||||
&self,
|
&self,
|
||||||
ix: usize,
|
|
||||||
d: &NaiveDate,
|
d: &NaiveDate,
|
||||||
offset_month: usize,
|
offset_month: usize,
|
||||||
window: &mut Window,
|
window: &mut Window,
|
||||||
|
|
@ -530,7 +529,7 @@ impl Calendar {
|
||||||
.map_or(false, |disabled| disabled.matched(&date));
|
.map_or(false, |disabled| disabled.matched(&date));
|
||||||
|
|
||||||
self.item_button(
|
self.item_button(
|
||||||
ix,
|
d.ordinal() as usize,
|
||||||
day.to_string(),
|
day.to_string(),
|
||||||
is_active,
|
is_active,
|
||||||
is_in_range,
|
is_in_range,
|
||||||
|
|
@ -732,9 +731,8 @@ impl Calendar {
|
||||||
)
|
)
|
||||||
.children(days.iter().map(|week| {
|
.children(days.iter().map(|week| {
|
||||||
h_flex().gap_0p5().justify_between().children(
|
h_flex().gap_0p5().justify_between().children(
|
||||||
week.iter().enumerate().map(|(ix, d)| {
|
week.iter()
|
||||||
self.render_day(ix, d, offset_month, window, cx)
|
.map(|d| self.render_day(d, offset_month, window, cx)),
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
}))
|
}))
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue