Skip to content

Commit 455c66d

Browse files
authored
Merge pull request #102 from opf/fix/breadcrumb-links
Fix target attribute in breadcrumb links
2 parents 94ec20c + b1bd1e2 commit 455c66d

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.changeset/nice-drinks-do.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@openproject/primer-view-components": patch
3+
---
4+
5+
Set target attribute on the actual link element in the Breadcrumb instead of the list element above

app/components/primer/beta/breadcrumbs.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ def render?
4848
class Item < Primer::Component
4949
attr_accessor :selected, :href
5050

51-
def initialize(href:, **system_arguments)
51+
def initialize(href:, target: "_self", **system_arguments)
5252
@href = href
53+
@target = target
5354
@system_arguments = deny_tag_argument(**system_arguments)
5455
@selected = false
5556

@@ -58,7 +59,7 @@ def initialize(href:, **system_arguments)
5859
end
5960

6061
def call
61-
link_arguments = { href: @href }
62+
link_arguments = { href: @href, target: @target }
6263

6364
if selected
6465
link_arguments[:"aria-current"] = "page"

0 commit comments

Comments
 (0)