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
dropdown-divider class is duplicated #378
Comments
Hey @gillespieza, Thanks for reporting this. I'll take a look either tonight or tomorrow and see where I need to fix this :) |
I wasn't using the latest version. My apologies. Once I updated, the issue went away. |
No apologies necessary, glad you got it fixed :) |
I am using the latest version 4.1.0 (just redownloaded again from https://github.com/wp-bootstrap/wp-bootstrap-navwalker/blob/master/class-wp-bootstrap-navwalker.php) and have the same problem. I embedded the menu with the following code:
Adding a sub-menu item with
results in the following item
As you can see the class is inserted twice
|
Hey @lanort, Sorry you are having issues. I can see in your markup that it is duplicated but in my test install it is not and I am not able to recreate this with the latest version from The markup that I end up with is:
Is there anything else at all you think might be relevant to help me recreate this issue and fix it? |
Thanks @pattonwebz. Is this the actual source code or already the interpreted one? I think in my browser also only the first class counts and the second one is ignored (this would end up the same as in your result). However I will check that on another website of mine tomorrow, just to make sure I or another plugin did not mess up anything. |
You make a good point, this is likely generated markup. I will check actual source as soon as I am able. I reopened the ticket since you confirmed this is still an issue. I might have spotted a potential fix for it earlier when scanning the code in my test install. Let me know what you see in your end, I'll be sure to check proper source on my end as well. |
Just tried the current version on another website and it had the same result: You can see it here http://neu.derzahn.at The dropdown-divider was inserted with this data: The interpreted code has the double class already stripped (but the source code of course still has the double class):
|
Note: this is still a bug. The class wp-bootstrap-navwalker/class-wp-bootstrap-navwalker.php Lines 502 to 504 in c856e94
and here wp-bootstrap-navwalker/class-wp-bootstrap-navwalker.php Lines 556 to 558 in c856e94
This is also the case for dropdown-header and dropdown-item-text .
|
When I run my rendered HTML source code through a validator, it shows that items with the class "dropdown-divider" are getting the class added twice.
Here is an example of my output:
<li itemscope="itemscope" itemtype="https://www.schema.org/SiteNavigationElement" id="menu-item-6731" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-6731 nav-item"><div class="dropdown-divider" title="----" class="dropdown-item dropdown-divider">/</div></li>
The last div is getting
class="dropdown-divider"
andclass="dropdown-item dropdown-divider"
The text was updated successfully, but these errors were encountered: