Skip to content

Commit

Permalink
Widen user search dropdown to fill width, and edit its text hint
Browse files Browse the repository at this point in the history
The updated dropdown hint is longer than before, so it doesn't fully display. The dropdown was therefore widened so that it shows the entire hint, filling the whitespace between it and the "Add" button.
  • Loading branch information
norrisng-bc committed Oct 31, 2023
1 parent 966c6de commit fb0e269
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 25 deletions.
4 changes: 4 additions & 0 deletions frontend/src/assets/primevue.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
}
}

.p-dropdown.usersearch {
width: 100% !important
}

.p-checkbox,
.p-radiobutton {
&.p-checkbox-checked,
Expand Down
54 changes: 29 additions & 25 deletions frontend/src/components/form/SearchUsers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const onReset = () => {
watch(selectedIDP, () => {
if (selectedIDP.value?.searchable) {
userSearchPlaceholder.value = `Enter an existing ${selectedIDP.value?.name} user's name or email address`;
userSearchPlaceholder.value = `Enter the full name or email address of an existing ${selectedIDP.value?.name}`;
} else {
userSearchPlaceholder.value = `Enter an existing user's ${selectedIDP.value?.name} email address`;
}
Expand Down Expand Up @@ -144,30 +144,34 @@ onMounted(() => {
/>
</div>

<Dropdown
v-model="userSearchInput"
:options="userSearch"
:option-label="(option) => getUserDropdownLabel(option)"
editable
:placeholder="userSearchPlaceholder"
class="mt-1 mb-4"
:class="invalidSelectedUser ? 'p-invalid' : ''"
@input="onInput"
@change="onChange"
/>
<Button
label="Add"
class="mt-1 mb-4 ml-3"
icon="pi pi-check"
:disabled="!selectedUser"
@click="onAdd"
/>
<Button
label="Cancel"
class="p-button-outlined mt-1 mb-4 ml-3"
icon="pi pi-times"
@click="onCancel"
/>
<div class="flex">
<div class="flex flex-auto">
<Dropdown
v-model="userSearchInput"
:options="userSearch"
:option-label="(option) => getUserDropdownLabel(option)"
editable
:placeholder="userSearchPlaceholder"
class="mt-1 mb-4 usersearch"
:class="invalidSelectedUser ? 'p-invalid' : ''"
@input="onInput"
@change="onChange"
/>
</div>
<Button
label="Add"
class="mt-1 mb-4 ml-3"
icon="pi pi-check"
:disabled="!selectedUser"
@click="onAdd"
/>
<Button
label="Cancel"
class="p-button-outlined mt-1 mb-4 ml-3"
icon="pi pi-times"
@click="onCancel"
/>
</div>
</div>
</template>

Expand Down

0 comments on commit fb0e269

Please sign in to comment.