🚨 Black Friday: 85% OFF Flatlogic Generator! 🚨 Build your custom CRM, ERP, or SaaS app with full code ownership—don’t miss out!

The image when clicked in Gallery page is not changed when sorted

Gravatar

The image when clicked in Gallery page is not changed when sorted by either descending. For example Picture A becomes last picture when sorted. When i click the first picture, It still shows Picture A. May i know how to resolve this?

User profile image

Hi, BrahderLau! To sort, we use a function that you can find in the sing-app-vue\src\pages\Extra\Gallery\Gallery.vue on line 189. That's where you can configure the sorting the way you want.

Gravatar

Hi Alexandr, what I meant was, for example, by default it is sorted as ascending, when I click the image A (first), the image is zoomed is shown as image A. However, when I sort it by descending and click image Z (first), the image is still shown as image A. This abnormal behaviour can be reproduced in the demo page for vue sing app gallery.

User profile image

Oh, yes, I see now, I apologize. Yes, thanks for that bug, we'll fix it soon.

Gravatar

Yes. Please let me know when it is fixed. Just a question is there any platform for me to report bug or to refer to the latest changes or fixes?

User profile image

I think you can use GitHub issues: https://github.com/flatlogic/sing-app-vue/issues

Gravatar

the link you provided is not working.

User profile image

I think if you bought the product, you must have access to the repository with the product. But anyway, as soon as we fix this bug, we will report it here.

User profile image

So, the solution was pretty simple: In src/pages/Extra/Gallery/Gallery.vue on line 32, change the line @click="index = imageIndex" to @click="index = image.id"

Gravatar

yeah I bought the product and it is still within license period. Could you further help me on accessing the repos

Gravatar

Hello! Could you please send your License ID and GitHub ID to [email protected] We will try to help you asap.

Gravatar

Hi, I used the exact code you suggested earlier. After sorting descending and ascending, the image clicked is following the actual index of the image still. I do not know why but it works in the demo with the same exact code.

User profile image

Yes, I beg your pardon, now I see.
Give me some time to figure it out

User profile image

And to fix the sorting error, in src/pages/Extra/Gallery/Gallery.vue on line 27 <gallery :images="images.map(img => img.src)" :index="index" @close="index = null" />

at

<gallery :images="getImages().map(img => img.src)" :index="index" @close="index = null" />

Image of solution

Solved
Gravatar

Thank you Alexandr, this solves my problem.