Skip to content

Commit

Permalink
Fix for Search Field Attribute Defaults (#1962)
Browse files Browse the repository at this point in the history
* Fix for Search Field Attribute Defaults

* SearchFieldAttributes -> Defaults To False
  • Loading branch information
lrljoe authored Sep 22, 2024
1 parent 1760c3c commit 1817b9f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Traits/Configuration/SearchConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function setSearchPlaceholder(string $placeholder): self

public function setSearchFieldAttributes(array $attributes = []): self
{
$this->setCustomAttributes('searchFieldAttributes', $attributes);
$this->setCustomAttributes('searchFieldAttributes', array_merge(['default' => false, 'default-colors' => false, 'default-styling' => false], $attributes));

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/Helpers/SearchHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function hasSearchPlaceholder(): bool

public function getSearchFieldAttributes(): array
{
return $this->getCustomAttributes('searchFieldAttributes');
return $this->getCustomAttributes('searchFieldAttributes', true);
}

public function shouldTrimSearchString(): bool
Expand Down
2 changes: 1 addition & 1 deletion tests/Traits/Configuration/SearchConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function test_can_set_search_placeholder(): void

public function test_can_set_search_field_attributes(): void
{
$this->assertSame(['default' => false, 'default-colors' => false, 'default-styling' => false], $this->basicTable->getSearchFieldAttributes());
$this->assertSame(['default' => true, 'default-colors' => true, 'default-styling' => true], $this->basicTable->getSearchFieldAttributes());

$this->basicTable->setSearchFieldAttributes(['class' => 'bg-blue', 'style' => 'font-size: 3em;']);

Expand Down

0 comments on commit 1817b9f

Please sign in to comment.