MCPcopy
hub / github.com/logamee/lin-ui / scrollIntoView

Function scrollIntoView

src/calendar/index.js:301–318  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

299 });
300 },
301 scrollIntoView() {
302 setTimeout(() => {
303 const { currentDate, type, show, minDate, maxDate } = this.data;
304 const targetDate = type === 'single' ? currentDate : currentDate[0];
305 const displayed = show;
306 if (!targetDate || !displayed) {
307 return;
308 }
309 const months = getMonths(minDate, maxDate);
310 months.some((month, index) => {
311 if (compareMonth(month, targetDate) === 0) {
312 this.setData({ scrollIntoViewIndex: `month${index}` });
313 return true;
314 }
315 return false;
316 });
317 }, 100);
318 },
319 closePicker() {
320 this.setData({
321 show: false

Callers

nothing calls this directly

Calls 2

getMonthsFunction · 0.90
compareMonthFunction · 0.90

Tested by

no test coverage detected