Skip to content

Commit c087bbf

Browse files
committed
Revert "Merge in extra attributes last in component"
This reverts commit 395dbfb.
1 parent 9c60087 commit c087bbf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<a href="{{ $item }}" {{ $attributes->except('item')->class([
22
'navigation-link block my-2 md:my-0 md:inline-block py-1 text-gray-700 hover:text-gray-900 dark:text-gray-100',
33
'navigation-link-active border-l-4 border-indigo-500 md:border-none font-medium -ml-6 pl-5 md:ml-0 md:pl-0 bg-gray-100 dark:bg-gray-800 md:bg-transparent dark:md:bg-transparent' => $item->isActive()
4-
])->merge([
4+
])->merge($item->getExtraAttributes())->merge([
55
'aria-current' => $item->isActive() ? 'page' : false,
6-
])->merge($item->getExtraAttributes()) }}>{{ $item->getLabel() }}</a>
6+
]) }}>{{ $item->getLabel() }}</a>

packages/framework/tests/Unit/Views/NavigationLinkViewTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function testComponentState()
9696
$view = $this->testView();
9797

9898
$expected = <<<'HTML'
99-
<a href="foo.html" class="navigation-link block my-2 md:my-0 md:inline-block py-1 text-gray-700 hover:text-gray-900 dark:text-gray-100 navigation-link-active border-l-4 border-indigo-500 md:border-none font-medium -ml-6 pl-5 md:ml-0 md:pl-0 bg-gray-100 dark:bg-gray-800 md:bg-transparent dark:md:bg-transparent" aria-current="page">Foo</a>
99+
<a href="foo.html" aria-current="page" class="navigation-link block my-2 md:my-0 md:inline-block py-1 text-gray-700 hover:text-gray-900 dark:text-gray-100 navigation-link-active border-l-4 border-indigo-500 md:border-none font-medium -ml-6 pl-5 md:ml-0 md:pl-0 bg-gray-100 dark:bg-gray-800 md:bg-transparent dark:md:bg-transparent">Foo</a>
100100
HTML;
101101

102102
$this->assertSame($expected, $view->getRendered());

0 commit comments

Comments
 (0)