Performance issue with date picker
What's the issue?
When you create a date picker which displays several month, e.g. 12 month then clicking a date requires a long time to display the selection. In my example on a very fast Mac the time was 1.6 seconds (see performance screenshot below)
How do we reproduce the issue?
Here the date picker configuration
<amp-date-picker
type="range"
mode="static"
layout="fixed-height"
id="range-date-picker"
height="345"
on="
select:
AMP.setState({
dates: event.dates,
startDate: event.start,
endDate: event.end
})"
format="M/D/YYYY"
src="/amptest.json"
number-of-months="12"
allow-blocked-ranges
start-input-selector="#range-start"
end-input-selector="#range-end"
class="example-picker space-between">
<template type="amp-mustache"
info-template>
<span [text]="(startDate && endDate ?
'You picked ' + startDate.date + ' as start date and ' + endDate.date + ' as end date.' :
'You will see your chosen dates here.')">
You will see your chosen dates here.
</span>
</template>
<template type="amp-mustache"
date-template
id="spooky">
<span>🙀</span>
</template>
</amp-date-picker>

Which AMP version is affected?
amp datepicker v0.1
I think this might be the same as #18345
Not sure. I am working on MacOs not iOS and it is not loading the date picker that is slow, it is the selection of a date that is very slow
Thanks for the report. Going to merge this with #18345 and add a referencing comment there.