Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Mar 6, 2021
1 parent 8ce4429 commit 2a0ec56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/forms/resources/views/components/select.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ function select(config) {
if (Object.keys(config.initialOptions).length) {
this.options = {}
let search = this.search.trim().toLowerCase()
for (let key in config.initialOptions) {
if (config.initialOptions[key].trim().toLowerCase().includes(this.search.trim().toLowerCase())) {
if (config.initialOptions[key].trim().toLowerCase().includes(search)) {
this.options[key] = config.initialOptions[key]
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/Resources/RelationManager/AttachRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ public function getForm()
->schema([
Select::make('related')
->label((string) Str::of($this->getRelationship())->singular()->ucfirst())
->placeholder(__('forms::fields.select.emptyOptionsMessage'))
->getDisplayValueUsing(fn ($value) => $value)
->placeholder('filament::resources/relation-manager.modals.attach.form.related.placeholder')
->getOptionSearchResultsUsing(function ($search) {
$relationship = $this->owner->{$this->getRelationship()}();

Expand Down

0 comments on commit 2a0ec56

Please sign in to comment.