File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
components/dash-core-components/src/components Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ const Textarea = ({
42
42
n_blur_timestamp = - 1 ,
43
43
n_clicks,
44
44
n_clicks_timestamp = - 1 ,
45
- persisted_props = [ 'value' ] ,
46
- persistence_type = 'local' ,
45
+ persisted_props,
46
+ persistence_type,
47
47
...props
48
48
} ) => {
49
49
const ctx = window . dash_component_api . useDashContext ( ) ;
@@ -73,6 +73,11 @@ const Textarea = ({
73
73
) ;
74
74
} ;
75
75
76
+ Textarea . dashPersistence = {
77
+ persisted_props : [ 'value' ] ,
78
+ persistence_type : 'local' ,
79
+ } ;
80
+
76
81
Textarea . propTypes = {
77
82
/**
78
83
* The ID of this component, used to identify dash components
Original file line number Diff line number Diff line change @@ -290,7 +290,9 @@ const getProps = layout => {
290
290
const { id, persistence} = props ;
291
291
292
292
const element = Registry . resolve ( layout ) ;
293
- const getVal = prop => props [ prop ] || ( element . defaultProps || { } ) [ prop ] ;
293
+ const getVal = prop =>
294
+ props [ prop ] ||
295
+ ( element . defaultProps || element . dashPersistence || { } ) [ prop ] ;
294
296
const persisted_props = getVal ( 'persisted_props' ) ;
295
297
const persistence_type = getVal ( 'persistence_type' ) ;
296
298
const canPersist = id && persisted_props && persistence_type ;
You can’t perform that action at this time.
0 commit comments