Port of https://github.com/twbs/bootstrap/pull/18614 from v4 to v3
Ref https://github.com/twbs/bootstrap/issues/19269