Skip to content

Commit

Permalink
fix: Use the correct select props and events for the non-searchable a…
Browse files Browse the repository at this point in the history
…ttach view (#30)
  • Loading branch information
staylorwr committed Oct 14, 2020
1 parent e408f6d commit d17e02d
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions assets/src/views/Attach.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,27 @@
{{ option.title }}
</div>
</search-input>
<select-control
<select
v-else
class="form-control form-select mb-3 w-full"
:class="{ 'border-danger': validationErrors.has(field.attribute) }"
:options="availableResources"
:selected="selectedResourceId"
label="title"
value-key="id"
@change="selectResourceFromSelectControl"
>
<option
value=""
disabled
selected
>
Choose {{ relatedResourceLabel }}
Choose {{ field.name }}
</option>
</select-control>

<option
v-for="resource in availableResources"
:key="resource.id"
:value="resource.id"
:selected="selectedResourceId == resource.id"
>
{{ resource.title }}
</option>
</select>
</template>
</default-field>

Expand Down Expand Up @@ -215,7 +218,7 @@ export default {
selectInitialResource () {
this.selectedResource = find(
this.availableResources,
r => r.value == this.selectedResourceId
r => r.id == this.selectedResourceId
);
},
Expand Down

0 comments on commit d17e02d

Please sign in to comment.