diff --git a/src/components/Form/fields/Autosuggest.vue b/src/components/Form/fields/Autosuggest.vue index 2da1184b9..2426c9676 100644 --- a/src/components/Form/fields/Autosuggest.vue +++ b/src/components/Form/fields/Autosuggest.vue @@ -156,20 +156,19 @@ const props = defineProps({ type: Boolean, default: () => true, }, - /* Prefix of the input's parent container and its label */ - controlPrefixId: { - type: String, - default: () => 'default-autosuggest', - }, + /** Field input id, usually used to connect with FormFieldLabel */ + inputId: {type: String, required: false, default: null}, + /** aria-describedby ids */ + describedBy: {type: String, required: false, default: ''}, }); /** * Props to pass to the input field */ const inputProps = { - 'aria-describedby': `${props.controlPrefixId}-selected`, + 'aria-describedby': `${props.describedBy}`, class: 'pkpAutosuggest__input', - id: `${props.controlPrefixId}-control`, + id: props.inputId, disabled: props.isDisabled, }; diff --git a/src/components/Form/fields/FieldBaseAutosuggest.vue b/src/components/Form/fields/FieldBaseAutosuggest.vue index 8fdf1777d..8d4ca04da 100644 --- a/src/components/Form/fields/FieldBaseAutosuggest.vue +++ b/src/components/Form/fields/FieldBaseAutosuggest.vue @@ -255,7 +255,8 @@ export default { selectedLabel: this.selectedLabel, currentSelected: this.currentSelected, isDisabled: this.isDisabled, - controlPrefixId: this.compileId(), + inputId: this.controlId, + describedBy: this.describedByIds, }; }, }, diff --git a/src/components/Form/fields/FieldRorAutosuggest.vue b/src/components/Form/fields/FieldRorAutosuggest.vue index 5eb747cb4..8ece34fe3 100644 --- a/src/components/Form/fields/FieldRorAutosuggest.vue +++ b/src/components/Form/fields/FieldRorAutosuggest.vue @@ -7,7 +7,7 @@ >