Cancel dropdown positioning if element isn't attached to the document

If the element isn't attached to the document (which can be determined by whether `body()` returns an empty list), then `positionDropdown()` errors out spectacularly. This adds a check right before its body.