From 9a246787262fc91ade89b8d1089c520c02574c5b Mon Sep 17 00:00:00 2001 From: christophe-g Date: Fri, 23 Nov 2018 18:21:26 +0100 Subject: [PATCH] added "always-selectable" to allows some steps to always be selectable --- ud-step.html | 7 +++++++ ud-stepper.html | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ud-step.html b/ud-step.html index d73e000..75c71a5 100644 --- a/ud-step.html +++ b/ud-step.html @@ -134,6 +134,13 @@ notify: true }, + /* + * `alwaysSelectable` true to allow the step to always be selectable, even if linead and completed + */ + alwaysSelectable: { + type: Boolean, + }, + /** * Determines if the step is completed. */ diff --git a/ud-stepper.html b/ud-stepper.html index 2a33a50..75159a2 100644 --- a/ud-stepper.html +++ b/ud-stepper.html @@ -594,11 +594,12 @@ * If stepper is linear: * - allow user to revisit a completed editable step * - allow user to revist an optional step as long as is not completed + * - bypass this logic for `always-selectable` */ if (this.linear) { const step = this._steps[evt.detail.selected]; if (!step) return; - if ((step.completed && step.editable) || (!step.completed && step.optional)) { + if ((step.completed && step.editable) || (!step.completed && step.optional) || step.alwaysSelectable) { return; } evt.preventDefault();