Skip to content

Commit

Permalink
fix(breadcrumbs): rails resolve has_back_icon bug (#1891)
Browse files Browse the repository at this point in the history
* fix(breadcrumbs): rails resolve has back icon prop bug when value is false

* chore(breadcrumbs): add comment for code clarity
  • Loading branch information
QuintonJason authored May 29, 2024
1 parent 4cd1b72 commit ea31830
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<%
has_back_icon = component.has_back_icon.present? ? component.has_back_icon : component.items.length() == 1
# The intent is to set this prop to false unless the has_back_icon prop is explicitly set
has_back_icon = component.has_back_icon.nil? ? component.items.length() == 1 : component.has_back_icon
is_progressbar = component.is_progressbar.present? && component.is_progressbar
%>
<nav
Expand Down Expand Up @@ -38,7 +39,7 @@ is_progressbar = component.is_progressbar.present? && component.is_progressbar
<i class="sage-breadcrumbs__icon sage-icon-arrow-left" aria-hidden="true"></i>
<% end %>
<%= component.items[0][:text] %>
</a>
</a>
</p>
<% end %>
</nav>

0 comments on commit ea31830

Please sign in to comment.