Skip to content

Commit 42f6827

Browse files
authored
Merge pull request nubasedev#310 from SferaDev/upload-files-accept
Allow customizing paste command options
2 parents 21799ee + e96e576 commit 42f6827

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/commands/command.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ export interface PasteOptions {
4747
* Command to execute on paste command
4848
*/
4949
command?: string;
50+
/**
51+
* The accept attribute specifies a filter for what file types the user can pick from the file input dialog box.
52+
*/
53+
accept?: string;
54+
/**
55+
* When present, it specifies that the user is allowed to enter more than one value in the file input dialog box.
56+
* By default is set to true
57+
*/
58+
multiple?: boolean;
5059
}
5160

5261
export type SaveImageHandler = (

src/components/ReactMde.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ export class ReactMde extends React.Component<ReactMdeProps, ReactMdeState> {
243243
<input
244244
className={classNames("image-input")}
245245
type="file"
246-
accept="image/*"
247-
multiple
246+
accept={this.props.paste.accept || "image/*"}
247+
multiple={this.props.paste.multiple || true}
248248
onChange={this.handleImageSelection}
249249
/>
250250
<span>{l18n.pasteDropSelect}</span>

0 commit comments

Comments
 (0)