Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was 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

@red-0ne

Description

@red-0ne

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions