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

Possible to disable click to select? #95

Open
MakakWasTaken opened this issue Dec 22, 2022 · 6 comments
Open

Possible to disable click to select? #95

MakakWasTaken opened this issue Dec 22, 2022 · 6 comments

Comments

@MakakWasTaken
Copy link

I have recently started using this project, but I ran into a feature limitation.

I was wondering if it is possible to make the FileUploader only be drag and drop? I am using it to overlay a table, so it would be preferred if it does not open the select file dialog when clicking a cell.

@chriswardo
Copy link

+1 for this. That would be great if possible. Thanks!

@ArtemKurtiakWork
Copy link

+1

1 similar comment
@ghost
Copy link

ghost commented Jan 23, 2023

+1

@nnavascues
Copy link

nnavascues commented Jan 24, 2023

+1

I believe a possible workaround is setting it as disabled, and then adjusting the ui styles if wanted; that way I achieved the 'only-drag-and-drop' behavior. Maybe it helps you @MakakWasTaken

@Nealsoni00
Copy link

@nnavascues do you have an example of how you wrote the desired behavior? I'm writing it now and publishing an example for others would be amazing!

@nnavascues
Copy link

nnavascues commented Feb 6, 2023

@Nealsoni00 Sure!
I have something made in Styled Components like this, hope it helps :)

<Container>
<FileUploader disabled {...otherProps} />
</Container>

export const Container = styled.div
{... other styles}
label {
// Overrides styles of the disabled drag&drop component
width: 100%;
border: none !important;
background: none !important;

> div {
  border: 1px solid ${(props) => props.theme.secondary.c300};
  background: transparent !important;
  color: transparent !important;
}

}
;

That way I managed to "hide" the disabled styles of the FileUploader

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

No branches or pull requests

5 participants