Skip to content

Width calculation fails when combined with ngShow/ngHide #22

@iangreenleaf

Description

@iangreenleaf

I ran into this situation and got quite the headache trying to fix it. I'm not sure what the best solution would be, but thought I'd bring it to your attention so you can consider.

The problem arises when:

  1. An orbicular element is under the effect of ng-hide or ng-show (or anything else which sets CSS of display:none).
  2. The orbicular element is created after the element has been hidden, not on load. For example, this can happen to a collection that is populated in the same digest cycle as the truth condition to show the collection.

This example shows the behavior. In this situation, the offsetWidth value is 0 because the element is not displayed, so Orbicular calculates the wrong font size and ends up hiding the element (even after display is changed and the element should be visible).

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