Replies: 2 comments 3 replies
-
So, I think for the most part this behavior is intended, but I understand that rendering a skipped step may have unwanted side effects. Instead of always rendering all steps and CSS hiding the ones that should be hidden, we could potentially only render the current step. However, for other components such as combobox, tabs, collapsible, you could make the same argument. In general I think it's better to use CSS hide/show in these cases, including for steps. I would probably advise you not to run side effects as part of being rendered to DOM, but run these side effects as a consequence of being "entered". updated(changedProperties) {
if (changedProperties.get('status') === 'entered') {
doSideEffect();
}
} |
Beta Was this translation helpful? Give feedback.
-
I just have a discussion related to this topic on slack: https://polymer.slack.com/archives/C03PF4L4L/p1615419006097500 the issue is that you can’t do that with custom elements currently. It could be done with custom templating or templating with lit-html TemplateResult. |
Beta Was this translation helpful? Give feedback.
-
Expected behavior
.condition - Dynamic condition, when true the step is added to the flow.
ing-step should not render the element inside it unless both of the below conditions are true:
Actual Behavior
In actuality even when .condition is false - the step is getting added to the DOM and simply skipped at the time of navigation. If we have properties which are dynamically generated (e.g, by calling a function) for a component defined inside the ing-step they get invoked and cause unwanted side-effects. ing-step must not render element inside it until the step is reached and also condition is evaluated to true.
Updated code sample (be prepared to see two annoying alert messages :P)
https://webcomponents.dev/edit/EeIjuQ4dTHZrr2l1OpV0
Additional context
Let me know if you need more info
Beta Was this translation helpful? Give feedback.
All reactions