-
-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constrain input for Step.options.buttons
to an array of buttons.
#271
Conversation
4c0bc24
to
a641253
Compare
index.md
Outdated
@@ -173,21 +173,21 @@ the step will execute. For example: | |||
}, | |||
``` | |||
- `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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eww... should be fixed now
@@ -140,11 +141,6 @@ describe('Shepherd Acceptance Tests', () => { | |||
.contains('Shepherd is a JavaScript library') | |||
.should('exist') | |||
.and('be.visible'); | |||
|
|||
// Step twp text should be hidden | |||
cy.contains('Including Shepherd is easy!') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this? We should keep the test functionality in place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.