Skip to content

Maximum call stack size exceeded on year change #94

@javier-godoy

Description

@javier-godoy

Describe the bug

I've started observing a Maximum call stack size exceeded exception when the year property is set programmatically.

year: {
type: Number,
value: new Date().getFullYear(),
notify: true
},

connectedCallback() {
super.connectedCallback();
this.addEventListener("selected-date-changed",this._onSelectedDateChanged);
this.addEventListener("year-changed",this._onYearChanged);
}

_onYearChanged(ev) {
if (ev.detail.value) {
this.dispatchEvent(new CustomEvent("year-changed", {
detail: { value: ev.detail.value }
}));
}
}

Image

Expected behavior

Setting the year property programmatically should not cause a Maximum call stack size exceeded exception. Instead, it should update the value without triggering infinite recursion.

Minimal reproducible example

document.querySelector("fc-year-calendar").year=2024;

Add-on Version

4.3.2-SNAPSHOT

Vaadin Version

24.7.0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions