Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update list-comments.js #163

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Update list-comments.js #163

wants to merge 1 commit into from

Conversation

djbuch
Copy link

@djbuch djbuch commented May 25, 2023

Questions Answers
Description? Correct a bug, where stars on additionnal products on a product page would have wrong star number, because the stars where inited before the grade retrivial
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket?
How to test? View a product page with additionnal products having comments, without this correction they would alwas have only one star.

Correct a bug, where stars on additionnal products on a product page would have wrong star number, because the stars where inited before the grade retrivial
@kpodemski
Copy link
Contributor

Hi @djbuch

Good to see you again in the project! Have you tried to do something like:

setTimeout(function() {
    $('.grade-stars').rating();
}, 0);

maybe that would help with the issues you have. otherwise, it's hard for me to understand why your code would be different if we target the same selectors, eventually

@djbuch
Copy link
Author

djbuch commented May 25, 2023 via email

@SharakPL
Copy link
Contributor

Hi @djbuch
Can you link an issue to be fixed by this PR or at least provide detailed info here? QA needs to know exactly what is it fixing to check if it's valid.

@djbuch
Copy link
Author

djbuch commented Mar 14, 2024

Hello,
I'm sorry but quite a year after this issue I don't remember what raised the problem on my side.

Nevertheless I remember it was the only way to correct this bug effectively. It is never a good idea to use to large selectors, as other module can need to init rating(), and sometimes on an async basis.

Regards,

@SharakPL
Copy link
Contributor

SharakPL commented Mar 15, 2024

I'm guessing it's for the product page where you have .grade-stars of the main product, but it's the same class for any product list item with rating so whenever a product page includes eg. accessories, crossselling module or same category products then all of them may have individual .grade-stars elements. We have to make sure only the one belonging to the main product changes. Is that right?

Although this main rating on the product page may be in several places so we might need further changes to cover all of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for review
4 participants