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 scrollspy and accented anchor links #38502

Merged
merged 1 commit into from
Apr 30, 2023

Conversation

alemendoza-v
Copy link
Contributor

@alemendoza-v alemendoza-v commented Apr 24, 2023

Description

The js/src/scrollspy.js file was changed. I used the decodeURI() method to allow french words as ids. This method was added to the line that finds the observable sections and the one that sets the target links.

Motivation & Context

French words were not allowed as ids for the Scrollspy component.

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Live previews

Related issues

N/A

@alemendoza-v alemendoza-v requested a review from a team as a code owner April 24, 2023 17:36
@alemendoza-v
Copy link
Contributor Author

Hello, I made a new PR, the test now runs properly locally. How can I add the live preview?

@mdo
Copy link
Member

mdo commented Apr 28, 2023

@GeoSot @XhmikosR Can you review for v5.3.0 stable?

@XhmikosR XhmikosR changed the title Fix scrollspy and french anchor links Fix scrollspy and accented anchor links Apr 28, 2023
@GeoSot
Copy link
Member

GeoSot commented Apr 29, 2023

@alemendoza-v can you please provide a codepen, showing the existing problem?
I tried a simple approach but couldn't get the difference
image

@alemendoza-v
Copy link
Contributor Author

@alemendoza-v can you please provide a codepen, showing the existing problem?

@GeoSot Hello, sure. If you comment out the parts that include the link to the french word the nav bar items will change to active, while when it is not commented out it will not.

https://codepen.io/alemendoza-v/pen/JjmyrJq

@GeoSot GeoSot force-pushed the scrollspy-french-anchor-links branch from 8348e9d to 0a52cf0 Compare April 30, 2023 15:38
@GeoSot
Copy link
Member

GeoSot commented Apr 30, 2023

Thanks a lot @alemendoza-v. Your example, helped to replicate

image

@alemendoza-v
Copy link
Contributor Author

@GeoSot No problem!

@XhmikosR XhmikosR merged commit a06c2e6 into twbs:main Apr 30, 2023
13 checks passed
romankupchak93 pushed a commit to romankupchak93/bootstrap that referenced this pull request Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants