question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'onDrop' does not fire in <ImageInput> options (react-admin 3.0.1)

See original GitHub issue

What you were expecting: ‘onDrop’ fires in <ImageInput> options

What happened instead: ‘onDrop’ does not fire in <ImageInput> options

Steps to reproduce: Define a function called ‘callback’ Add ‘options={{onDrop:callback}}’ in <ImageInput>

Related code:

const callback = () => { console.log("callback"); }

<ImageInput source="pictures" label="Related pictures" accept="image/*" options={{onDrop:callback}}>
       <ImageField source="src" title="title" />
</ImageInput>

Environment

  • React-admin version: 3.0.1
  • React version: 16.9.0
  • Browser: Chrome Version 78.0.3904.97 (Official Build) (64-bit)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
djhicommented, Nov 28, 2019

Sorry, that’s not an option, you can pass it as a prop directly

1reaction
DAIGOR1024commented, Nov 28, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

how to pass onDrop callback to ImageInput - reactjs
I am trying to pass a callback so I can use ImageInput to save the files/images before the form is ...
Read more >
The ImageInput Component - React-admin - Marmelab
Prop Required Type Default accept Optional string | string ‑ children Optional ReactNode ‑ minSize Optional number 0
Read more >
Research Artefact: A Large-Scale Study of React-Related ...
Id PostTypeId AcceptedAnswerId OwnerUserId AnswerCount CommentCount Fa... 27279488 1 29040342 674474 3 5 0 29314839 1 29437736 2802074 2 2 3 30459180 1 30459458 745952 1...
Read more >
react-admin: Versions - Openbase
Full version history for react-admin including change logs.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found