Skip to content

fix(step): Use async context for stepper context#2228

Merged
damyanpetev merged 1 commit into
masterfrom
rkaraivanov/stepper-async-context
May 15, 2026
Merged

fix(step): Use async context for stepper context#2228
damyanpetev merged 1 commit into
masterfrom
rkaraivanov/stepper-async-context

Conversation

@rkaraivanov
Copy link
Copy Markdown
Member

Description

Use async context for stepper context

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Checklist

  • My code follows the project's coding standards
  • I have tested my changes locally

Copilot AI review requested due to automatic review settings May 14, 2026 08:43
@rkaraivanov rkaraivanov requested a review from damyanpetev May 14, 2026 08:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Replaces the synchronous @consume decorator on IgcStepComponent with the project's createAsyncContext controller so that the stepper context is correctly bound when a step is connected before its parent stepper exists, then later re-parented.

Changes:

  • Switch step.ts from @lit/context's @consume decorator to the createAsyncContext helper that defers ContextConsumer creation until after updateComplete.
  • Add a regression test verifying that a step connected to the document before the stepper still binds context correctly after being adopted by a stepper.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/components/stepper/step.ts Removes @consume decorator and uses createAsyncContext controller, assigning the resolved context via callback.
src/components/stepper/stepper.spec.ts Adds a new "Context binding" test to verify the deferred context binding after step re-parenting.

@damyanpetev damyanpetev merged commit 4bc6375 into master May 15, 2026
11 checks passed
@damyanpetev damyanpetev deleted the rkaraivanov/stepper-async-context branch May 15, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants