Skip to content

Commit

Permalink
#923: remove autoSelectFirst for screenreader
Browse files Browse the repository at this point in the history
  • Loading branch information
lehju committed May 27, 2024
1 parent 8bed61e commit 2262d0b
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<v-autocomplete
v-model="selectedUsers"
:aria-required="isRequired()"
:auto-select-first="autoSelectFirst"
:class="[isReadonly() ? 'userInputReadonly' : 'userInput']"
:disabled="disabled"
:filter="filterUsers"
Expand All @@ -12,7 +13,6 @@
:readonly="isReadonly()"
:rules="rules ? rules : true"
:search-input.sync="searchText"
auto-select-first
chips
hide-no-data
item-text="username"
Expand Down Expand Up @@ -97,11 +97,12 @@

<script lang="ts">
import {UserTO} from "@muenchen/digiwf-engine-api-internal";
import {defineComponent, PropType, ref, watch} from "vue";
import {computed, defineComponent, PropType, ref, watch} from "vue";
import {callGetUserById, callGetUserByUsername, callSearchUser,} from "../../api/user/userApiCalls";
import {mucatarURL} from "../../constants";
import {checkRequired} from "./validation/required";
import {useAccessibility} from "../../store/modules/accessibility";
export interface OnProperty {
input: (value: any) => void;
Expand Down Expand Up @@ -176,6 +177,10 @@ export default defineComponent({
const errorMessage = ref("");
const lastSearch = ref("");
const a11YNotificationEnabled = useAccessibility().a11YNotificationEnabled;
const autoSelectFirst = computed(() => !a11YNotificationEnabled());
watch(searchText, (newValue) => {
searchUsersBySearchString(newValue);
});
Expand Down Expand Up @@ -279,6 +284,7 @@ export default defineComponent({
}
return {
autoSelectFirst,
resetInput,
change,
getFullName,
Expand Down

0 comments on commit 2262d0b

Please sign in to comment.