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

Calculations are wrong if used inside Bootstrap tab (and potentially other DOM changes) #12

Open
roberttolton opened this issue Feb 26, 2016 · 1 comment

Comments

@roberttolton
Copy link

I don't see a method in the documentation to force a re-calculation, would such a thing be workable?

The calculations are fine on the first load if they are in the first active tab, but if you switch to another tab or they aren't in the first active tab, the heights are miscalculated (due to the elements not being visible at the time of calculation I would assume).

@ajordanow
Copy link

As a dirty workaround you can try the following:

  1. Add something like uib-tab(select='vm.triggerResizeEvent()') to tab with "vertilized" content.
  2. Implement triggerResizeEvent() in the corresponding controller:
        this.triggerResizeEvent = function () {
            // without this resize event fires too early
            $window.requestAnimationFrame(function () {
                $timeout(function () {
                    angular.element($window).trigger('resize');
                });
            });
        };

It flickers a bit but at least works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants