Skip to content
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

How to force the update of the Tippy instance from the directive? #98

Open
GitHubish opened this issue Apr 28, 2022 · 3 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@GitHubish
Copy link

I use the Tippy directive and I would like to be able to refresh its position after opening it because its position is sometimes problematic when it is at the bottom of the page. So I wanted to make sure that when the (visible) event is called do a forceUpdate.

Example:

<button [tippy]="myPopper" [placement]="'bottom-end'"
        variation="popper" [data]="item" #popper="tippy" (visible)="popperIsVisible($event, popper)">
        Action
</button>
popperIsVisible(state: boolean, popper: TippyDirective) {
    popper.popperInstance.forceUpdate(); 
    //OR DIRECTLY
    popper.forceUpdate()
}

Is it possible to expose the popper instance in the directive or to have a forceUpdate() method directly?

@NetanelBasal
Copy link
Member

I don't mind exposing a forceUpdate method from the directive

@NetanelBasal NetanelBasal added enhancement New feature or request good first issue Good for newcomers labels Apr 28, 2022
@GitHubish
Copy link
Author

@NetanelBasal it would be really great!

@baleeds
Copy link

baleeds commented Jun 29, 2022

@NetanelBasal thanks for looking into this! Could we also expose the update() method on the popper instance as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants