-
Notifications
You must be signed in to change notification settings - Fork 6.7k
feat(typeahead): Custom CSS class for typeahead's dropdown menu #4410
Conversation
This makes a lot of sense - can you add a test for this feature to verify that the class is properly being set? |
@wesleycho Added tests for: basic, with a custom template and with append-to-body. |
@@ -895,6 +908,12 @@ describe('typeahead tests', function() { | |||
$timeout.flush(); | |||
expect(dropdown.css('top')).toEqual('500px'); | |||
}); | |||
|
|||
it('should add a custom class to append-to-body popup', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test begs the question, if the user uses typeahead-append-to-body
, should the component remove this class from the body tag when the element is destroyed? I think it should here.
Left a comment - I think we will need to garbage collect and remove the custom class from the |
@wesleycho The custom class is being added to a popup element, not to |
Can you link me to a Plunker with the changes applied so I can see it in action? |
@wesleycho I've added a demo case for this PR with both |
Just would be convenient - unfortunately my schedule is super packed for this week and a half, so it could be difficult for me to investigate in detail to verify, and any bit of help would be much appreciated. |
@wesleycho Np, here is Plunker: http://plnkr.co/edit/XasKUluu256ztava34oF?p=preview |
I see, thanks a lot, this looks good to me! |
- Adds support for custom classes on the typeahead dropdown Closes angular-ui#4332 Closes angular-ui#4410
PR for #4332 with the corresponding demo.
Typeahead directive checks if an optional attribute
typeahead-dropdown-custom-class
is specified, and adds it to the dropdown main container. Works with append-to-body attribute.For example: attribute
typeahead-dropdown-custom-class="demo-class"
will adddemo-class
like this:<div class="dropdown-menu demo-class">
.