Skip to content

Commit

Permalink
added "always-selectable" to allows some steps to always be selectable
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-g committed Nov 23, 2018
1 parent 2ef9a98 commit 9a24678
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ud-step.html
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
3 changes: 2 additions & 1 deletion ud-stepper.html
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9a24678

Please sign in to comment.