Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Tooltips in ng-repeat keep showing the content of the first triggered one #2935

Closed
red-0ne opened this issue Nov 6, 2014 · 4 comments
Closed

Comments

@red-0ne
Copy link

red-0ne commented Nov 6, 2014

The following test did not pass on faf38d2

it('should show text of triggered item on ngRepeat no matter which is triggered first', inject( function( $compile ) {

    elm = $compile( angular.element(
      '<ul>'+
        '<li ng-repeat="item in items">'+
          '<span tooltip="{{item}}"></span>'+
        '</li>'+
      '</ul>'
    ) )( scope );

    scope.items = [ 'First item', 'Second Item' ];

    scope.$digest();

    var tt_one = angular.element( elm.find('li > span')[0] );
    var tt_two = angular.element( elm.find('li > span')[1] );

    tt_one.trigger( 'mouseenter' );
    tt_one.trigger( 'mouseleave' );

    tt_two.trigger( 'mouseenter' );

    var tt_two_inner = angular.element( elm.find('li:eq(1) .tooltip-inner')[0] );
    expect( tt_two_inner.text() ).toBe( scope.items[1] );

    tt_two.trigger( 'mouseleave' );
  }));

Note that the scope in tt_two has a valid value.

@chrisirhc
Copy link
Contributor

Could you please create a Plunker that demonstrates the issue that you are having?
It makes it easier to understand the issue by testing out the actual use case.
Due to the changes in the scoping in the tooltips, this test may need to be modified, but I want to understand if this is a test issue or an actual interaction issue.

@red-0ne
Copy link
Author

red-0ne commented Nov 7, 2014

@chrisirhc
Copy link
Contributor

Thanks for reporting this and including a test case and Plunker!

@red-0ne
Copy link
Author

red-0ne commented Nov 11, 2014

Thank you.

OronNadiv pushed a commit to lanetix/bootstrap that referenced this issue Nov 18, 2014
Thanks to @red-0ne for the test case.

This commit reverts a1b1ec4
(angular-ui#2825) .

Fixes angular-ui#2935
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants