Skip to content

Commit be351ce

Browse files
author
Adam Bradley
committed
fix(headerBarView): check for null in getTextBounds
In Android <= 4.3, getBoundingClientRect does not return a rect for a text node, closes #1377.
1 parent a0b61e0 commit be351ce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

js/views/headerBarView.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343

4444
childSize = null;
4545
if(c.nodeType == 3) {
46-
childSize = ionic.DomUtil.getTextBounds(c).width;
46+
var bounds = ionic.DomUtil.getTextBounds(c);
47+
if(bounds) {
48+
childSize = bounds.width;
49+
}
4750
} else if(c.nodeType == 1) {
4851
childSize = c.offsetWidth;
4952
}

0 commit comments

Comments
 (0)