             textField.addTarget(self, action: #selector(textFieldEditingChanged), for: .editingChanged)
             textField.addTarget(self, action: #selector(textFieldEditingEnded), for: .editingDidEnd)
 
-            updateFrame()
+            setupConstraints()
         }
     }
     /** A `LUAutocompleteTableViewCell` subclass that will be used to show a text suggestion.

    fileprivate var elements = [String]() {
        didSet {
            tableView.reloadData()
            updateFrame()
        }
    }


        tableView.bounces = false
    }

    private func setupConstraints() {
        guard let textField = textField else {
            assertionFailure("Sanity check")
            return
        }

        tableView.removeConstraints(tableView.constraints)
        removeConstraints(self.constraints)

        tableView.translatesAutoresizingMaskIntoConstraints = false
        translatesAutoresizingMaskIntoConstraints = false

        heightConstraint = heightAnchor.constraint(equalToConstant: 0)

        let constraints = [
            tableView.leadingAnchor.constraint(equalTo: leadingAnchor),
            tableView.trailingAnchor.constraint(equalTo: trailingAnchor),
            tableView.topAnchor.constraint(equalTo: topAnchor),
            tableView.bottomAnchor.constraint(equalTo: bottomAnchor),
            leadingAnchor.constraint(equalTo: textField.leadingAnchor),
            trailingAnchor.constraint(equalTo: textField.trailingAnchor),
            topAnchor.constraint(equalTo: textField.bottomAnchor),
            heightConstraint!
        ]

        NSLayoutConstraint.activate(constraints)
    }

    @objc private func textFieldEditingChanged() {
