Skip to content

fix(ContactDetailsAvatar): tabbing - #5593

Open
GVodyanov wants to merge 1 commit into
mainfrom
fix/tabbing-contact-details
Open

fix(ContactDetailsAvatar): tabbing#5593
GVodyanov wants to merge 1 commit into
mainfrom
fix/tabbing-contact-details

Conversation

@GVodyanov

Copy link
Copy Markdown
Contributor

Fix #5579

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@GVodyanov GVodyanov self-assigned this Jul 26, 2026
@GVodyanov
GVodyanov requested a review from hamza221 as a code owner July 26, 2026 20:53
@GVodyanov GVodyanov added the 3. to review Waiting for reviews label Jul 26, 2026
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...components/ContactDetails/ContactDetailsAvatar.vue 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread src/components/ContactDetails/ContactDetailsAvatar.vue Outdated
@GVodyanov
GVodyanov requested review from hamza221 and odzhychko August 9, 2026 08:54
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
@GVodyanov
GVodyanov force-pushed the fix/tabbing-contact-details branch from dc7d632 to 6ec1b66 Compare August 9, 2026 08:54

@odzhychko odzhychko left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code works and fixes the linked issue.

const ccc = `data:${type};base64,${data.toString('base64')}`
this.$refs.cropper.replace(ccc)
this.showCropper = true
await this.$nextTick()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion(non-blocking): Replace showCropper with cropperSrc. Avoids $nextTick and simplifies code overall.

diff --git a/src/components/ContactDetails/ContactDetailsAvatar.vue b/src/components/ContactDetails/ContactDetailsAvatar.vue
index 68ac0e89f..cddfa8424 100644
--- a/src/components/ContactDetails/ContactDetailsAvatar.vue
+++ b/src/components/ContactDetails/ContactDetailsAvatar.vue
@@ -30,10 +30,11 @@
                        :url="photoUrl"
                        class="contact-header-avatar__photo" />
 
-               <NcModal v-if="showCropper" size="small" @close="cancel">
+               <NcModal v-if="cropperSrc" size="small" @close="cancel">
                        <div class="avatar__container">
                                <h2>{{ t('contacts', 'Crop contact photo') }}</h2>
                                <VueCropper
+                                       :src="cropperSrc"
                                        ref="cropper"
                                        class="avatar__cropper"
                                        v-bind="cropperOptions" />
@@ -179,7 +180,7 @@ export default {
                        loading: false,
                        photoUrl: undefined,
                        root: generateRemoteUrl(`dav/files/${getCurrentUser().uid}`),
-                       showCropper: false,
+                       cropperSrc: undefined,
                        cropperOptions: {
                                aspectRatio: 1 / 1,
                                viewMode: 3,
@@ -252,7 +253,7 @@ export default {
                                }
                        }
 
-                       await this.openCropper(data, type)
+                       this.openCropper(data, type)
                        return true
                },
 
@@ -262,11 +263,8 @@ export default {
                 * @param {Buffer} data the image
                 * @param {string} type of the image
                 */
-               async openCropper(data, type) {
-                       const ccc = `data:${type};base64,${data.toString('base64')}`
-                       this.showCropper = true
-                       await this.$nextTick()
-                       this.$refs.cropper.replace(ccc)
+               openCropper(data, type) {
+                       this.cropperSrc = `data:${type};base64,${data.toString('base64')}`
                },
 
                /**
@@ -417,7 +415,7 @@ export default {
                 * Save the cropped image
                 */
                saveAvatar() {
-                       this.showCropper = false
+                       this.cropperSrc = undefined
                        this.loading = true
 
                        this.$refs.cropper.getCroppedCanvas({
@@ -455,7 +453,7 @@ export default {
                 * Cancel cropping
                 */
                cancel() {
-                       this.showCropper = false
+                       this.cropperSrc = undefined
                        this.loading = false
                },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tab and Shift+Tab do not move focus between contact fields

3 participants