Skip to content

Commit a698a51

Browse files
committed
Reset buttons when overridden.
1 parent 25780f6 commit a698a51

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Html/Options/Plugins/Buttons.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ trait Buttons
2121
*/
2222
public function buttons(...$buttons): static
2323
{
24+
$this->attributes['buttons'] = [];
25+
2426
if (is_array($buttons[0])) {
2527
$buttons = $buttons[0];
2628
}

tests/BuilderOptionsPluginsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function it_has_buttons_plugin()
6060
Button::make('remove'),
6161
]);
6262

63-
$this->assertCount(3, $builder->getButtons());
63+
$this->assertCount(1, $builder->getButtons());
6464
}
6565

6666
/** @test */

0 commit comments

Comments
 (0)