Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib##10935 hide input field in autosuggest if one item allowed and value selected #526

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/components/Form/fields/Autosuggest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
@update:model-value="selectSuggestion"
>
<ComboboxInput
v-show="!(hideIfDisabled && (isDisabled || !enableSuggestions))"
class="pkpAutosuggest__input"
v-bind="inputProps"
autocomplete="off"
Expand Down Expand Up @@ -185,6 +186,11 @@ const props = defineProps({
type: Boolean,
default: () => false,
},
/** Hide input value field if disabled */
hideIfDisabled: {
type: Boolean,
default: () => false
},
/** Field input id, usually used to connect with FormFieldLabel */
inputId: {type: String, required: false, default: null},
/** aria-describedby ids */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
>
<Autosuggest
v-bind="autoSuggestProps"
:hide-if-disabled="true"
@update:input-value="updateInputValue"
@select-suggestion="handleSelect"
@deselect="handleDeselect"
Expand Down