File tree Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -344,17 +344,22 @@ describe("Renders", () => {
344
344
### Props
345
345
346
346
``` tsx
347
- export interface SimpleMdeReactProps
347
+ export interface SimpleMDEReactProps
348
348
extends Omit <React .HTMLAttributes <HTMLDivElement >, " onChange" > {
349
349
id? : string ;
350
- onChange? : (value : string ) => void ;
350
+ onChange? : (value : string , changeObject ? : EditorChange ) => void ;
351
351
value? : string ;
352
352
extraKeys? : KeyMap ;
353
353
options? : SimpleMDE .Options ;
354
354
events? : SimpleMdeToCodemirrorEvents ;
355
- getMdeInstance? : (instance : SimpleMDE ) => void ;
356
- getCodemirrorInstance? : (codemirror : Editor ) => void ;
357
- getLineAndCursor? : (position : Position ) => void ;
355
+ getMdeInstance? : GetMdeInstance ;
356
+ getCodemirrorInstance? : GetCodemirrorInstance ;
357
+ getLineAndCursor? : GetLineAndCursor ;
358
+ placeholder? : string ;
359
+ textareaProps? : Omit <
360
+ React .HTMLAttributes <HTMLTextAreaElement >,
361
+ " id" | " style" | " placeholder"
362
+ >;
358
363
}
359
364
```
360
365
Original file line number Diff line number Diff line change @@ -76,6 +76,11 @@ export interface SimpleMDEReactProps
76
76
getMdeInstance ?: GetMdeInstance ;
77
77
getCodemirrorInstance ?: GetCodemirrorInstance ;
78
78
getLineAndCursor ?: GetLineAndCursor ;
79
+ placeholder ?: string ;
80
+ textareaProps ?: Omit <
81
+ React . HTMLAttributes < HTMLTextAreaElement > ,
82
+ "id" | "style" | "placeholder"
83
+ > ;
79
84
}
80
85
81
86
const useHandleEditorInstanceLifecycle = ( {
@@ -155,6 +160,8 @@ export const SimpleMdeReact = React.forwardRef<
155
160
getCodemirrorInstance,
156
161
onChange,
157
162
id : anId ,
163
+ placeholder,
164
+ textareaProps,
158
165
...rest
159
166
} = props ;
160
167
@@ -291,7 +298,13 @@ export const SimpleMdeReact = React.forwardRef<
291
298
elementWrapperRef . current = aRef ;
292
299
} }
293
300
>
294
- < textarea id = { id } ref = { setTextRef } style = { { display : "none" } } />
301
+ < textarea
302
+ { ...textareaProps }
303
+ id = { id }
304
+ placeholder = { placeholder }
305
+ ref = { setTextRef }
306
+ style = { { display : "none" } }
307
+ />
295
308
</ div >
296
309
) ;
297
310
} ) ;
You can’t perform that action at this time.
0 commit comments