code: function(el, selectEl) {
                      var rect = selectEl.getBoundingClientRect();
                      var dropdownTop = rect.bottom;
  
                      var deltaUp = Math.min(
                          Math.max(dropdownTop + el.clientHeight - window.innerHeight, 0),
                          rect.top + rect.height
                      );
  
                      assign(el.style, {
                          left: rect.left + 'px',
                          top: dropdownTop - deltaUp + 'px',
                          width: rect.width + 'px'
                      });
                  }
docs: Dropdowns for single-value inputs should open below the select box, unless there is not enough space below, in which case the dropdown should be moved up just enough so it fits in the window, but never so much that it reaches above the top.