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.

dynamic toolip text - tooltip not removed when you clear the value while tooltip is visible and vice versa #559

Closed

Description

@fxck

Let's say I have an input

<input ng-model="url" tooltip="{{ form.url.$valid | returnOnlyWhenFalse }}" name="url" type="url" />

now if I focus the input and start typing, ideally I would like the tooltip to appear when $valid becames false which is not going to happen unless I mouseleave and mouseenter again..

and the problem is the other way around as well, if I mousenter and $valid is false, tooltip's gonna be visible, if $valid becames true, tooltip's not gonna dissappear, it's just gonna get its text removed

you can see this behaviour here http://angular-ui.github.io/bootstrap/#/tooltip focus the dynamic input and the mouseover the dynamic tooltip

any idea how can I "hotfix" this?

Activity

  1. fxck commented on Jun 25, 2013

    @fxck
    Author

    hm well the hot fix would be to change

    if ( ! scope.tt_content ) {} to only still show the tooltip, but hidden and then something like this

              attrs.$observe( type, function ( val ) {
                if (!val) {
                  hide();
                }
    
                tooltip.css({opacity: 1});
    
                scope.tt_content = val;
              });

    it's clunky but it works, hopefully this could be configurable later

  2. fxck commented on Jun 27, 2013

    @fxck
    Author

    the problem is with positioning though, it doesn't get it right..

  3. pkozlowski-opensource commented on Jul 13, 2013

    @pkozlowski-opensource
    Member

    Duplicate of #590

    We need to add ability to control tooltips programatically

  4. geersch commented on Jul 16, 2014

    @geersch

    For now I just use the following workaround:

    attrs.$observe(type, function (val) {
        scope.tt_content = val;
        setTimeout(function() {
            if (!val) {
                hideTooltipBind();
            } else {
                showTooltipBind();
            }
        }, 1);
    });
    

    Not ideal and sadly the setTimeout(...) is to circumvent an issue with positioning the next time the tooltip is shown. It doesn't center correctly if you call showTooltipBind() directly.

  5. added a commit that references this issue on Sep 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions