-
-
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
Change data-id
to data-shepherd-step-id
on Step content elements.
#282
Conversation
clashResiliance++;
46134ec
to
b019124
Compare
@@ -190,7 +190,7 @@ export class Step extends Evented { | |||
_createTooltipContent() { | |||
const content = document.createElement('div'); | |||
const classes = this.options.classes || ''; | |||
const element = createFromHTML(`<div class='${classes}' data-id='${this.id}' id="step-${this.options.id}-${uniqueId()}"}>`); | |||
const element = createFromHTML(`<div class='${classes}' data-shepherd-step-id='${this.id}' id="step-${this.options.id}-${uniqueId()}"}>`); |
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'm good w/ removing the ID
attr, but since with multiple tours we can have shared ids, can we do something to make sure this value is unique?
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.
@chuckcarpenter I think we should have a single data-shepherd-step-id
attr that does what id
is currently doing.
Is that what you're suggesting?
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.
Then again, do we need uniqueness here?
We were discussing having a data-shepherd-active-tour
attribute on the body. If we implement that, someone could always use it as the context for querying unique steps -- even if steps share ids across tours.
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.
@chuckcarpenter @rwwagner90 To summarize, I'm thinking we merge this PR as-is, then open up another issue for adding data-shepherd-active-tour
attribute to the body
and removing the extra id
attribute on steps.
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 agree, we have current tour on the body, so that solves the specificity issue.
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.
@chuckcarpenter Where are you seeing that? I'm thinking we still need to implement it. Right now, it looks like we're just indicating the current step:
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.
you're right. It's in the BM frontend right now.
// TODO: add this in Shepherd.js
document.body.setAttribute('data-shepherd-active-tour', tourName);
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.
that said, should the tour id be part of the ID for the step?
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.
Follows up on the discussion [here](#282 (comment)).
Follows up on the discussion [here](#282 (comment)).
Follows up on the discussion [here](#282 (comment)).
Follows up on the discussion [here](#282 (comment)).
Follows up on the discussion [here](#282 (comment)).
clashResiliance++;