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

Anonymous div is wrapping Dashboard #3550

Closed
frederikhors opened this issue Mar 9, 2022 · 13 comments
Closed

Anonymous div is wrapping Dashboard #3550

frederikhors opened this issue Mar 9, 2022 · 13 comments
Labels

Comments

@frederikhors
Copy link
Contributor

As reported here too by @natschz the Dashboard component is wrapped in anonymous <div> hard to to target with css selectors and this situation make hard to change properties like 100%.

Can we please avoid that unuseful div?

image

@arturi
Copy link
Contributor

arturi commented Mar 10, 2022

Thanks for reporting. Is this with a React component? Plain JS Dashboard doesn’t have that extra wrapper:

Screenshot 2022-03-10 at 12 57 12

@frederikhors
Copy link
Contributor Author

I'm using it with Svelte.

@natschz
Copy link

natschz commented Mar 10, 2022

It's happening with the React component as well.

@Murderlon
Copy link
Member

I'm not sure if I can get rid of it because AFAIK it can't be a React fragment as we need it as a ref:

    return h('div', {
      ref: (container) => {
        this.container = container
      },
      ...this.validProps,
    })

But I could easily add an id or class if that helps. However I'm not sure what problem you're facing, because the width and height props on Dashboard still work as expected?

@frederikhors
Copy link
Contributor Author

In Svelte you don't need any new div, right?

@natschz
Copy link

natschz commented Mar 15, 2022

Yea, so I'm not into the uppy source code, but having a class on that div, would at least make it possible to target it via css, which probably would be of great help.

@frederikhors
Copy link
Contributor Author

You can do it already now. What I don't need is that useless div.

@natschz
Copy link

natschz commented Mar 15, 2022

Of course you can but it could get unnecessary complicated, but I also agree that we don't need that div.

@Murderlon
Copy link
Member

Murderlon commented Mar 16, 2022

In Svelte you don't need any new div, right?

I'm not an expert on Svelte, but AFAIK this doesn't differ from my React example. We need a ref for the plugin to attach to.

<div bind:this={container} />

Perhaps it is possible to retrieve uppy-Root and turn that into a ref.

@natschz
Copy link

natschz commented Mar 18, 2022

If you find a way to remove that div, this would be awesome! But if not I think at least it should get a class, so it is easier to target as wells as not having just one random div wrapping it, because initially I was just wondering where the div is coming from.

@cmsnegar

This comment was marked as spam.

@arturi
Copy link
Contributor

arturi commented May 13, 2022

Added CSS class for the wrapper container in #3692 for React and Svelte, other integrations to follow.

@Murderlon
Copy link
Member

Closing this as we can't get rid of the div but we did add a class on it. If you feel differently, feel free to discuss and we could reopen if necessary.

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

5 participants