Skip to content

Commit 1817b9f

Browse files
authored
Fix for Search Field Attribute Defaults (rappasoft#1962)
* Fix for Search Field Attribute Defaults * SearchFieldAttributes -> Defaults To False
1 parent 1760c3c commit 1817b9f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Traits/Configuration/SearchConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function setSearchPlaceholder(string $placeholder): self
156156

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

161161
return $this;
162162
}

src/Traits/Helpers/SearchHelpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function hasSearchPlaceholder(): bool
137137

138138
public function getSearchFieldAttributes(): array
139139
{
140-
return $this->getCustomAttributes('searchFieldAttributes');
140+
return $this->getCustomAttributes('searchFieldAttributes', true);
141141
}
142142

143143
public function shouldTrimSearchString(): bool

tests/Traits/Configuration/SearchConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function test_can_set_search_placeholder(): void
180180

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

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

0 commit comments

Comments
 (0)