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

fix(anchor): affichage de l'ancre au niveau de l'accordéon sur les fiches-ministère-travail #5831

Merged
merged 7 commits into from
May 7, 2024

Conversation

maxgfr
Copy link
Member

@maxgfr maxgfr commented Apr 30, 2024

fix #4865

@maxgfr maxgfr requested a review from m-maillot April 30, 2024 13:50
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link
Contributor

@m-maillot m-maillot left a comment

Choose a reason for hiding this comment

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

Quand je fais la recherche : Quelle est la situation du salarie a la fin du contrat

Et que je sélectionne le résultat : La démission : quelle est la situation du salarié à la fin du contrat ?

L'accordéon est bien ouvert mais l'écran ne scroll pas sur l'accordéon ouvert. Il le fait bien si j'arrive sur la page directement.

@carolineBda
Copy link
Contributor

carolineBda commented May 6, 2024

Quand je fais la recherche : Quelle est la situation du salarie a la fin du contrat

Et que je sélectionne le résultat : La démission : quelle est la situation du salarié à la fin du contrat ?

L'accordéon est bien ouvert mais l'écran ne scroll pas sur l'accordéon ouvert. Il le fait bien si j'arrive sur la page directement.

Ah oui étrage que ça ne marche pas quand on click... Il faudrait implémenter un scroll en js si le flag preExpanded est true

Copy link

github-actions bot commented May 6, 2024

@carolineBda carolineBda self-requested a review May 6, 2024 12:58
Comment on lines +24 to +31
React.useEffect(() => {
if (props?.preExpanded?.length && props.preExpanded[0]?.length) {
const anchor = document?.querySelector(`#${props.preExpanded[0]}`);
if (anchor) {
anchor.scrollIntoView();
}
}
}, [props.preExpanded]);
Copy link
Member Author

Choose a reason for hiding this comment

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

ça me va perso

@carolineBda carolineBda merged commit 0bf84f4 into dev May 7, 2024
23 checks passed
@carolineBda carolineBda deleted the maxgfr/fix-anchor branch May 7, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] réparer la fonctionnalité de pré-ouverture des accordéon avec un anchor tag
4 participants