bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

docs(examples): use button for navbar dropdown toggle

Open TheDerbiedOne opened this issue 6 months ago • 3 comments

Fixes #40995

Updates the navbar examples to use a <button class="nav-link dropdown-toggle" type="button"> instead of an <a href="#"> for the dropdown toggle, avoiding docs that recommend an unsemantic placeholder link.

TheDerbiedOne avatar Jun 01 '26 02:06 TheDerbiedOne

Thank you for sharing.

Can you please confirm that you have exhaustively searched the entire code base and that no a.dropdown-toggle remain?

fulldecent avatar Jun 01 '26 13:06 fulldecent

Thanks — I double-checked.

I searched the repo for <a ... dropdown-toggle ...> and there are still a number of occurrences (including in tests and other docs/examples). This PR intentionally keeps scope narrow to the navbar docs example discussed in #40995, replacing that dropdown toggle anchor with a semantic <button class="nav-link dropdown-toggle" type="button" ...>.

If you’d like, I can follow up with a separate PR to convert the remaining docs examples (and/or tests), but it’d be a broader sweep than this single-example fix.

TheDerbiedOne avatar Jun 01 '26 16:06 TheDerbiedOne

Thanks for creating this PR, @TheDerbiedOne.

This PR should address the documentation more broadly to ensure consistency across the entire docs set.

We should also carefully assess the impact of the changes related to this issue. For example, simply replacing <a> with <button> (even while using the appropriate classes) on the Sidebars example page does not produce exactly the same rendering, so there may be additional considerations beyond the markup change itself.

julien-deramond avatar Jun 07 '26 19:06 julien-deramond