Skip to content

ReferenceError: grid is not defined in fc-year-calendar.js #111

@javier-godoy

Description

@javier-godoy

Describe the bug

When the browser window is wide enough to display all 12 months in a single row (responsive step minWidth: 132em, columns: 12), navigating with Ctrl+arrow keys throws ReferenceError: grid is not defined in fc-year-calendar.js. The error occurs inside getNumPerRow() at line 210, which references an undeclared variable grid instead of children.

return (breakIndex === -1 ? grid.length : breakIndex);
//                          ^^^^ grid is never declared; should be children.length

Expected behavior

Ctrl+arrow key navigation works correctly at all responsive breakpoints.

Minimal reproducible example

YearCalendar calendar = new YearCalendar();
add(calendar);
// Widen the browser window until all 12 months appear in one row, then press Ctrl+Right

Add-on Version

4.6.1-SNAPSHOT

Vaadin Version

N/A

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions