IgniteUI / igniteui-webcomponents

Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.
https://www.infragistics.com/products/ignite-ui-web-components
Other
119 stars 3 forks source link

Stepper Styling (material) differs from Angular Stepper (and Figma) - Potential issue #704

Closed andiesm813 closed 11 months ago

andiesm813 commented 1 year ago

Description

If you see the current Stepper Sample in Storybook, when you advance on the steps, the previous ones don't get the "completed" style, like the Angular sample has (and also the Figma UI kit version too).

image

I'm saying this is a potential issue because maybe the "completed" style is already implemented, but the sample is not 100% functional and the steps never change their look to the completed style.

Expected Result

  1. Steps 1 and 2, who are supposed to be completed (if step 3 is the active one) should change their color to that dark gray and white foreground.
  2. The progress line also turns darker.
  3. The steps ahead (not completed) also have like a "disabled" style.
ddaribo commented 1 year ago

Hi @andiesm813,

The completed property of the IgxStepComponent and the corresponding complete of the IgcStepComponent are intended to be controlled by the developer.

The Angular demo from the screenshot has its steps’ completed property bound to custom conditions in the template, for instance: <igx-step #step2 [isValid]="businessInformationForm.form.valid" [completed]="businessInformationForm.form.valid">

The IgcStepper storybook does not contain such logic. It can be added, for example setting the complete property of the previously active step to true on user interaction when the igcActiveStepChanging event is emitted: <igc-stepper .. @igcActiveStepChanging=${handleActiveStepChanging} >

  const handleActiveStepChanging = (ev: CustomEvent<any>) => {
    const oldActiveStepIndex = ev.detail.oldIndex;
    const stepper = document.getElementById('stepper') as IgcStepperComponent;
    stepper.steps[oldActiveStepIndex].complete = true;
  }

In this line of thought, it appears the Web Components Stepper Example does not mark the steps as completed and in that sense differs from the Angular demo. Maybe that should be addressed for the sample, @teodosiah?

teodosiah commented 1 year ago

Sure, @ddaribo, can you please log it into the Web Components samples repo?

ddaribo commented 1 year ago

Logged.