-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Added submenuOptions property to Dropdown #7427
Conversation
A submenu options array adds flexibility to the dropdown, allowing custom attributes to be added to submenus. This patch doesn't break BC, as it sets submenuOptions to options, if it has not been explicitly set. However it does get the rid of the dropdown-menu class that is currently set on submenus, causing them to be hidden by default.
You have a failing test here: https://travis-ci.org/yiisoft/yii2/jobs/52027817#L917 can you please fix it? |
Looks like that fixed it. Sorry, I'm new to unit tests. They're still on my todo list to get familiar with! |
Test doesn't look right now. |
@samdark do you think that the submenu should have the class |
Ah, then it's probably fine. |
Thanks @samdark . The test is definitely now correct as far as my code change is concerned. As long as you are all happy with the logic of my code change, then all is well. |
Should I add to the test to include settings for the new submenuOptions property? |
Yes, that would be great. |
Ok, my new test passes, but I'm wondering if I should make submenuOptions a property of each item, rather than the whole widget. That way you could set it differently per level, if required. Perhaps I should have created an issue for this rather than just a PR?! |
@spikyjt, can you please resubmit this PR up to yii2-bootstrap repo? |
Migrated to yiisoft/yii2-bootstrap#41 |
A submenu options array adds flexibility to the dropdown, allowing custom attributes to be added to submenus. This patch doesn't break BC, as it sets submenuOptions to options, if it has not been explicitly set. However it does get the rid of the dropdown-menu class that is currently set on submenus, causing them to be hidden by default.