Skip to content

fix: remove update cycle from calendar#6633

Open
GZolla wants to merge 1 commit intomainfrom
gzolla/inspiration-calendar-updates
Open

fix: remove update cycle from calendar#6633
GZolla wants to merge 1 commit intomainfrom
gzolla/inspiration-calendar-updates

Conversation

@GZolla
Copy link
Contributor

@GZolla GZolla commented Feb 25, 2026

@GZolla GZolla requested a review from a team as a code owner February 25, 2026 19:01
@github-actions
Copy link
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://live.d2l.dev/prs/BrightspaceUI/core/pr-6633/

Note

The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

);
if (dropdownContent) this._dialog = true;

this.addEventListener('blur', () => this._isInitialFocusDate = true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting... so just the fact that these event handlers were being wired up in firstUpdated was somehow causing an extra update cycle?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were not, the rest of the firstUpdate code was, so we could keep them on firstUpdated but it would be the only thing there. And anyways, I believe this fits better with the recommended pattern for lit event handling.

The examples on that page define internal listeners on the constructor but does not explicitly recommend that approach. It does however explicitly recommend that external listeners (e.g. for window or other components) would be defined on connectedCallback, so might as well define internal listeners here too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: we have some best practices for this in the Daylight docs with explanation which I believe aligns with the Lit documentation.

While handlers on this can be managed from connected/disconnectedCallback, wiring up in that lifecycle method really just preferred when wiring up handlers to external elements. Wiring up to this in firstUpdated or the constructor simplifies managing it. There's the perf things too, but I think it is probably negligible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants