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

Dropzone should automatically set a data-attribute when disabled #6946

Closed
2 tasks done
pgrones opened this issue Oct 7, 2024 · 3 comments
Closed
2 tasks done

Dropzone should automatically set a data-attribute when disabled #6946

pgrones opened this issue Oct 7, 2024 · 3 comments
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@pgrones
Copy link

pgrones commented Oct 7, 2024

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.13.2

What package has an issue?

@mantine/dropzone

What framework do you use?

Vite

In which browsers you can reproduce the issue?

All

Describe the bug

Currently Dropzone only adds a data-attribute when the input is loading. The documentation is asking the developer to implement their own disabled state if the loading state isn't enough. However I would argue that setting a disabled data-attribute when the disabled flag is set would help a lot in styling non-loading, disabled states.

To give a more tangible example, we override a lot of Mantine's default css behaviors in a custom package. When a developer uses the package and marks the Dropzone as disabled they would also need to set mod={{ disabled }} to make the css overrides work, as there is no way to differentiate between a disabled Dropzone and an active one.

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

Simply add disabled to the list of data-attributes

<Dropzone
  mod={[
    {
      accept: isDragAccept,
      reject: isDragReject,
      idle: isIdle,
      loading,
      disabled,
      'activate-on-click': activateOnClick,
    },
    mod,
  ]}
>

Self-service

  • I would be willing to implement a fix for this issue
@Aldomf
Copy link

Aldomf commented Oct 8, 2024

Hello @pgrones, can i be assigned this task?

@pgrones
Copy link
Author

pgrones commented Oct 8, 2024

Hello @pgrones, can i be assigned this task?

Sure I don't mind who fixes the issue as long as there is no argument against implementing it

rtivital added a commit that referenced this issue Oct 16, 2024
@rtivital rtivital added the Fixed patch Completed issues that will be published with next patch (1.0.X) label Oct 16, 2024
@rtivital
Copy link
Member

Fixed in 7.13.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

3 participants