function bpFieldInitSelect2Element(element) {
    // element will be a jQuery wrapped DOM node
    if (!element.hasClass("select2-hidden-accessible"))
    {
        let isFieldInline = element.data('field-is-inline');
        let placeholder = element.data('field-placeholder');
        let allowClear = element.data('field-allow-clear');

        element.select2({
            theme: "bootstrap",
            placeholder: placeholder,
            allowClear: allowClear,
            dropdownParent: isFieldInline ? $('#inline-create-dialog .modal-content') : $(document.body)
        });
    }
}

        