Skip to content

Commit

Permalink
fix[#50499] Add first-breadcrumb-element css class in BreadcrumbHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
dominic-braeunlein committed Nov 20, 2023
1 parent 2488cf9 commit 4a55a14
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/helpers/breadcrumb_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ module BreadcrumbHelper
def full_breadcrumbs
items = breadcrumb_paths.compact
render(Primer::Beta::Breadcrumbs.new(data: { 'test-selector': "op-breadcrumb" })) do |breadcrumbs|
items.each do |item|
items.each_with_index do |item, index|
item = anchor_string_to_object(item) if item.is_a?(String) && item.start_with?("\u003c")

if item.is_a?(Hash)
breadcrumbs.with_item(href: item[:href]) { item[:text] }
breadcrumbs.with_item(href: item[:href], classes: index == 0 ? "first-breadcrumb-element" : nil) { item[:text] }
else
breadcrumbs.with_item(href: "#") { item }
breadcrumbs.with_item(href: "#", classes: index == 0 ? "first-breadcrumb-element" : nil) { item }
end
end
end
Expand Down

0 comments on commit 4a55a14

Please sign in to comment.