-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add support for optional progress step bar labels #107
Conversation
3cd6ab8
to
07c2615
Compare
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.
lgtm, two pieces of unsolicited advice here.... and you may wish to get another review if you're looking for any specific context-based comments.
</div> | ||
|
||
<div class="progress-step-bar__label <%= 'sr-only' if local_assigns[:step_description].nil? %>" id="<%= label_id %>"> |
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.
a nitpick: local_assigns[:step_description].blank?
is marginally better for checking text presence
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.
good point! wasn't thinking about programmatically rendering a step description (imagine people will manually provide) when I wrote
@@ -1,11 +1,20 @@ | |||
<% step_name = local_assigns[:step_name] || 'Step' %> | |||
<% label_id = "progress-step-bar--#{step_name}-#{current_step + 1}-#{step_count}-label".downcase %> |
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.
for components partials, I've seen a pattern of all local_assigns
usages at the top, so users of the component can see all the parameters. I don't know if we want to adopt that pattern but if we did it would include step_description
up here as well... e.g.
<% step_name = local_assigns[:step_name] || 'Step' %>
<% step_description = local_assigns[:step_description] %>
(I think the styleguide example is sufficient here, this is just a thought)
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 like that pattern suggestion!
Also adds screenreader description of graphic regardless of whether or not description is provided.
this was very much solicited feedback. thanks for taking a look @tdooner ! |
Finishes #105
Usages: