Skip to content

Commit

Permalink
fix: fix vue refs targets (again) (#6676)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Jun 13, 2023
1 parent 133e426 commit 7b8997c
Show file tree
Hide file tree
Showing 58 changed files with 140 additions and 181 deletions.
2 changes: 1 addition & 1 deletion resources/js/Components/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defineProps({
defineEmits(['update:modelValue']);
const input = ref(null);
const focus = () => nextTick(() => input.value.focus());
const focus = () => nextTick().then(() => input.value.focus());
onMounted(() => {
if (input.value.hasAttribute('autofocus')) {
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Components/Jetstream/ConfirmsPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const startConfirmingPassword = () => {
} else {
confirmingPassword.value = true;
nextTick(() => passwordInput.value.focus());
nextTick().then(() => passwordInput.value.focus());
}
});
};
Expand All @@ -62,7 +62,7 @@ const confirmPassword = () => {
.catch((error) => {
form.processing = false;
form.error = error.response.data.errors.password[0];
nextTick(() => passwordInput.value.focus());
nextTick().then(() => passwordInput.value.focus());
});
};
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Components/Jetstream/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const close = () => {
onMounted(() => {
document.addEventListener('keydown', onKeydown);
if (_.find(useAttrs(), (item, key) => key === 'autofocus') > -1) {
nextTick(() => {
nextTick().then(() => {
select.value.focus();
open.value = true;
});
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Pages/Profile/Partials/DeleteUserForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ const form = useForm({
const confirmUserDeletion = () => {
confirmingUserDeletion.value = true;
nextTick(() => passwordInput.value.focus());
nextTick().then(() => passwordInput.value.focus());
};
const deleteUser = () => {
form.delete(route('current-user.destroy'), {
preserveScroll: true,
onSuccess: () => closeModal(),
onError: () => nextTick(() => passwordInput.value.focus()),
onError: () => nextTick().then(() => passwordInput.value.focus()),
onFinish: () => form.reset(),
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ const form = useForm({
const confirmLogout = () => {
confirmingLogout.value = true;
nextTick(() => passwordInput.value.focus());
nextTick().then(() => passwordInput.value.focus());
};
const logoutOtherBrowserSessions = () => {
form.delete(route('other-browser-sessions.destroy'), {
preserveScroll: true,
onSuccess: () => closeModal(),
onError: () => nextTick(() => passwordInput.value.focus()),
onError: () => nextTick().then(() => passwordInput.value.focus()),
onFinish: () => form.reset(),
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<!-- content -->
<text-input
:ref="'content'"
ref="content"
v-model="form.content"
:label="$t('Which email address should we send the notification to?')"
:type="'email'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newAddressType'"
ref="newAddressType"
v-model="form.name"
:label="$t('Name')"
:type="'text'"
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Pages/Settings/Personalize/CallReasons/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newCallReasonType'"
ref="newCallReasonType"
v-model="form.callReasonTypeName"
:label="$t('Name')"
:type="'text'"
Expand Down Expand Up @@ -232,7 +232,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newReason'"
ref="newReason"
v-model="form.label"
:label="$t('Name')"
:type="'text'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newContactInformationType'"
ref="newContactInformationType"
v-model="form.name"
:label="$t('Name')"
:type="'text'"
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Settings/Personalize/Genders/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newGender'"
ref="newGender"
v-model="form.name"
:label="$t('Name')"
:type="'text'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newGiftOccasion'"
ref="newGiftOccasion"
v-model="form.label"
:label="$t('Name')"
:type="'text'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newGiftState'"
ref="newGiftState"
v-model="form.label"
:label="$t('Name')"
:type="'text'"
Expand Down
6 changes: 3 additions & 3 deletions resources/js/Pages/Settings/Personalize/GroupTypes/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newGroupType'"
ref="newGroupType"
v-model="form.label"
:label="$t('Name')"
:type="'text'"
Expand Down Expand Up @@ -221,7 +221,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newRole'"
ref="newRole"
v-model="form.label"
:label="$t('Name')"
:type="'text'"
Expand Down Expand Up @@ -260,7 +260,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newRole'"
ref="newRole"
v-model="form.label"
:label="$t('Name')"
:type="'text'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newPetCategory'"
ref="newPetCategory"
v-model="form.name"
:label="$t('Name')"
:type="'text'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newPostTemplate'"
ref="newPostTemplate"
v-model="form.label"
:label="$t('Name')"
:type="'text'"
Expand Down Expand Up @@ -227,7 +227,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newSection'"
ref="newSection"
v-model="form.label"
:label="$t('Name')"
:type="'text'"
Expand Down Expand Up @@ -268,7 +268,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newSection'"
ref="newSection"
v-model="form.label"
:label="$t('Name')"
:type="'text'"
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Settings/Personalize/Pronouns/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newPronoun'"
ref="newPronoun"
v-model="form.name"
:label="$t('Name')"
:type="'text'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newGroupType'"
ref="newGroupType"
v-model="form.relationshipGroupTypeName"
:label="$t('Name')"
:type="'text'"
Expand Down Expand Up @@ -287,7 +287,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newRelationshipType'"
ref="newRelationshipType"
v-model="form.name"
:label="$t('Name')"
:type="'text'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newReligion'"
ref="newReligion"
v-model="form.name"
:label="$t('Name')"
:type="'text'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newTemplate'"
ref="newTemplate"
v-model="form.name"
:label="$t('Name')"
:type="'text'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<errors :errors="form.errors" />

<text-input
:ref="'newPage'"
ref="newPage"
v-model="form.name"
:label="$t('Name')"
:type="'text'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ const enableEditMode = () => {
const focusNameOrder = () => {
disableNameOrder.value = false;
nextTick(() => {
nameOrder.value.focus();
});
nextTick().then(() => nameOrder.value.focus());
};
const helpDocumentation = () => {
Expand Down Expand Up @@ -202,7 +200,7 @@ const submit = () => {
</div>
<div class="ms-8">
<text-input
:ref="'nameOrder'"
ref="nameOrder"
v-model="form.nameOrder"
:type="'text'"
:autofocus="true"
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Vault/Contact/Goals/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

<!-- name -->
<text-input
:ref="'newName'"
ref="newName"
v-model="form.name"
:label="$t('Name')"
:type="'text'"
Expand Down
18 changes: 9 additions & 9 deletions resources/js/Pages/Vault/Contact/ImportantDates/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ const errors = ref(null);
const showCreateModal = () => {
createDateModalShown.value = true;
nextTick(() => createForm.value.reset());
nextTick().then(() => createForm.value.reset());
};
const updateDateModal = (date, i) => {
const updateDateModal = (date) => {
editedDateId.value = date.id;
nextTick(() => editForm.value[i].reset());
nextTick().then(() => editForm.value[0].reset());
};
const created = (date) => {
Expand Down Expand Up @@ -123,18 +123,18 @@ const destroy = (date) => {
<CreateOrEditImportantDate
v-if="createDateModalShown"
class="mb-6"
:ref="'createForm'"
ref="createForm"
:data="data"
@close="createDateModalShown = false"
@created="created" />

<div v-else>
<div v-if="!createDateModalShown">
<!-- list of dates -->
<ul
v-if="localDates.length > 0"
class="mb-6 rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900">
<li
v-for="(date, i) in localDates"
v-for="date in localDates"
:key="date.id"
class="item-list border-b border-gray-200 hover:bg-slate-50 dark:border-gray-700 dark:bg-slate-900 hover:dark:bg-slate-800">
<!-- detail of the important date -->
Expand All @@ -151,7 +151,7 @@ const destroy = (date) => {

<!-- actions -->
<ul class="text-sm">
<li class="me-4 inline cursor-pointer" @click="updateDateModal(date, i)">
<li class="me-4 inline cursor-pointer" @click="updateDateModal(date)">
<span class="text-blue-500 hover:underline">{{ $t('Edit') }}</span>
</li>
<li class="inline cursor-pointer text-red-500 hover:text-red-900" @click="destroy(date)">
Expand All @@ -162,9 +162,9 @@ const destroy = (date) => {

<!-- edit date modal -->
<CreateOrEditImportantDate
:ref="'editForm'"
ref="editForm"
:date="date"
v-show="editedDateId === date.id"
v-if="editedDateId === date.id"
:data="data"
@close="editedDateId = 0"
@update:date="updated" />
Expand Down
Loading

0 comments on commit 7b8997c

Please sign in to comment.