ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Negative viewport height

Open priceld opened this issue 11 years ago • 2 comments

We've run into an issue where it is possible to resize a grid such that the getViewportHeight() method returns a negative value (basically anytime the gridHeight is less than the headerHeight).

Granted, this is an edge case but it would be nice if ui-grid could protect against this since a negative value is not valid for the CSS height property.

Seems like this should be beyond trivial (return (viewPortHeight > 0) ? viewPortHeight : 0;) in both getViewportHeight methods, but I'm not familiar with the ui-grid code so I don't know all the implications of changing this.

priceld avatar Mar 17 '15 15:03 priceld

@priceld sorry it's taken so long to get to this.

Did you mean for your commits to include changes to cellnav? Seems like that's separate from viewport height calculations.

c0bra avatar Apr 16 '15 21:04 c0bra

@c0bra No worries.

Yeah, that was intentional. Seems like any place that does the same viewport height calculation (gridHeight - headerHeight - footerHeight) should be consistent. I'm open to other solutions as well.

priceld avatar Apr 17 '15 11:04 priceld