Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please split up braintree.dropin.create() into separate initialize and mount #717

Open
cmawhorter opened this issue Apr 6, 2021 · 1 comment
Labels

Comments

@cmawhorter
Copy link

General information

  • SDK/Library version: 1.27.0
  • Environment: Sandbox
  • Browser and Chrome/mac

Issue description

Please split up async braintree.dropin.create() into async initialize() and a sync mount().

That way I could background the initialize/async stuff on page load and not have to show a second spinner to display the payment form.

Additionally, because of the requirement the DOM element be empty to use (why not just empty it?), I can't easily set my own placeholder and it means I have to deal with a janky content shift:

  1. dropin container renders/added to dom
  2. page looks broken until drop-in renders its spinner (which is delayed for some reason)
  3. spinner renders and page content shifts to accommodate spinner height
  4. form renders. page content shifts again to accommodate the different form height

If you must continue with things that way please add load/ready events so I can show and hide my own wait ui.

As it stands right now my current plan is to render the form to a container that is not attached to the dom and then attach/detach it when the payment step is rendered. Which is pretty hacky.

@crookedneighbor
Copy link
Contributor

I'm marking this issue with the label for v2. I think you make a lot of good points, and we'll definitely take them into consideration for the design of v2 of the Drop-in SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants