Constrain input for Step.options.buttons to an array of buttons.#271
Constrain input for Step.options.buttons to an array of buttons.#271RobbieTheWagner merged 3 commits intomasterfrom
Step.options.buttons to an array of buttons.#271Conversation
4c0bc24 to
a641253
Compare
index.md
Outdated
| - `classes`: Extra classes to add to the step. `shepherd-theme-arrows` will give you our theme. | ||
| - `buttons`: An array of buttons to add to the step. By default we add a Next button which triggers `next()`, set this to false | ||
| - `buttons`: An array of buttons to add to the step. These will be rendered in a footer below the main body text. | ||
| to disable. Each button in the array is an object of the format: |
There was a problem hiding this comment.
This text is messed up. Got some random sentence fragments. The bullet points below also should not have been moved, as they are now in line with buttons, rather than nested under it.
There was a problem hiding this comment.
Eww... should be fixed now
| .and('be.visible'); | ||
|
|
||
| // Step twp text should be hidden | ||
| cy.contains('Including Shepherd is easy!') |
There was a problem hiding this comment.
Why remove this? We should keep the test functionality in place.
There was a problem hiding this comment.
I think it was wrong when I added it in the first place.
The hidden steps souldn't exist in the DOM at all. And also, Cy works in a way that it will try to wait until it finds something -- which causes it to hang here.
There was a problem hiding this comment.
Unless we changed something, hidden steps definitely should exist in the DOM. Once a step is created and inserted into the DOM, it remains there, but is just set to hidden=true. In this case, it may not have been inserted into the DOM yet, but if that is the case, we should do a couple next/back clicks to make sure it is inserted into the DOM, and hidden when on another step. Not sure if we already have tests covering that or not.
There was a problem hiding this comment.
We set this.el to hidden, but then we also call hide on the tippy instance.
hide() {
this.trigger('before-hide');
if (this.el) {
this.el.hidden = true;
// We need to manually set styles for < IE11 support
this.el.style.display = 'none';
}
document.body.('data-shepherd-step');
if (this.target) {
this.target.classList.remove('shepherd-enabled', 'shepherd-target');
}
if (this.tooltip) {
this.tooltip.hide();
}
this.trigger('hide');
}Since the former is contained in the later, it gets removed from the DOM
a641253 to
8ba716a
Compare
8ba716a to
6ff644f
Compare
Closes #243
@rwwagner90 This should also fix our flaky buttons test that was occasionally failing on Travis.