Skip to content
Snippets Groups Projects
Commit fd486858 authored by Ivica Puljic's avatar Ivica Puljic
Browse files

Issue #3443463 by pivica: Floating label JS code for control/label check...

Issue #3443463 by pivica: Floating label JS code for control/label check should check if label exist first
parent 682b3487
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@
elements.forEach(function (el, i) {
var control = el.querySelector('.form-control, .form-select');
var label = el.querySelector('label');
if (control.offsetWidth < label.offsetWidth) {
if (label && control.offsetWidth < label.offsetWidth) {
var paddingRight = parseFloat(window.getComputedStyle(control).getPropertyValue('padding-right'));
var adjustedWidth = label.offsetWidth + paddingRight;
// Respect maximum parent width (when controls are in the grid, etc).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment