amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Performance issue with date picker

Open Felixbachmann opened this issue 8 years ago • 3 comments

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> image

Which AMP version is affected?

amp datepicker v0.1

Felixbachmann avatar Sep 27 '18 02:09 Felixbachmann

I think this might be the same as #18345

mcmd avatar Sep 27 '18 11:09 mcmd

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

Felixbachmann avatar Sep 27 '18 12:09 Felixbachmann

Thanks for the report. Going to merge this with #18345 and add a referencing comment there.

dreamofabear avatar Sep 27 '18 21:09 dreamofabear