braintree / braintree-web-drop-in

Braintree Drop-in for the web
MIT License
200 stars 126 forks source link

DropinError, Vue 3, "options.selector or options.container must reference an empty DOM node" #754

Closed zainali99 closed 3 years ago

zainali99 commented 3 years ago

General information

Issue description

I was integrating the package: braintree-web-drop-in and the rendering of the component works, only one thing i notice that i get this strange error: image

searching on, i see the lines: #472

this condition is returning to me true, in my opinion it should be: ..trim() == ""

code:

var e = document.querySelector('#bt-dropin')
console.log(e, e.innerHTML, e.innerHTML.trim());
dropin.create({
            authorization: code,
            container: "#bt-dropin",
            vaultManager: true,
            threeDSecure: true,
            locale: vm.getBraintreeLocale,
            card: {
                cardholderName: true,
            },
            dataCollector: {
                paypal: true,
            },
        }, function(createErr, dropinInstance) {
            vm.dropinInstance = dropinInstance;
            console.log(createErr, dropinInstance)
            if (dropinInstance.isPaymentMethodRequestable()) {
                // This will be true if you generated the client token
                // with a customer ID and there is a saved payment method
                // available to tokenize with that customer.
                vm.showSubmitButton = true;
            }

            dropinInstance.on("paymentMethodRequestable", function() {
                vm.showSubmitButton = true;
            });

            dropinInstance.on("noPaymentMethodRequestable", function() {
                vm.showSubmitButton = false;
            });
        }
zainali99 commented 3 years ago

nevermind im calling twice the rendering function, closing.