@@ -35,15 +35,16 @@ function getCellType(
35
35
active : boolean ,
36
36
editable : boolean ,
37
37
dropdown : IDropdownValue [ ] | undefined ,
38
- presentation : Presentation | undefined
38
+ presentation : Presentation | undefined ,
39
+ is_loading : boolean
39
40
) : CellType {
40
41
switch ( presentation ) {
41
42
case Presentation . Input :
42
- return ( ! active || ! editable ) ? CellType . Label : CellType . Input ;
43
+ return ( ! active || ! editable || is_loading ) ? CellType . Label : CellType . Input ;
43
44
case Presentation . Dropdown :
44
45
return ( ! dropdown || ! editable ) ? CellType . DropdownLabel : CellType . Dropdown ;
45
46
default :
46
- return ( ! active || ! editable ) ? CellType . Label : CellType . Input ;
47
+ return ( ! active || ! editable || is_loading ) ? CellType . Label : CellType . Input ;
47
48
}
48
49
}
49
50
@@ -62,7 +63,8 @@ class Contents {
62
63
data : Data ,
63
64
_offset : IViewportOffset ,
64
65
isFocused : boolean ,
65
- dropdowns : ( IDropdown | undefined ) [ ] [ ]
66
+ dropdowns : ( IDropdown | undefined ) [ ] [ ] ,
67
+ data_loading : boolean
66
68
) : JSX . Element [ ] [ ] => {
67
69
const formatters = R . map ( getFormatter , columns ) ;
68
70
@@ -76,7 +78,8 @@ class Contents {
76
78
columnIndex ,
77
79
rowIndex ,
78
80
datum ,
79
- formatters
81
+ formatters ,
82
+ data_loading
80
83
) , columns ) , data ) ;
81
84
} ) ;
82
85
@@ -87,7 +90,8 @@ class Contents {
87
90
data : Data ,
88
91
offset : IViewportOffset ,
89
92
isFocused : boolean ,
90
- dropdowns : ( IDropdown | undefined ) [ ] [ ]
93
+ dropdowns : ( IDropdown | undefined ) [ ] [ ] ,
94
+ data_loading : boolean
91
95
) : JSX . Element [ ] [ ] => {
92
96
if ( ! activeCell ) {
93
97
return contents ;
@@ -112,20 +116,22 @@ class Contents {
112
116
jActive ,
113
117
iActive ,
114
118
data [ i ] ,
115
- formatters
119
+ formatters ,
120
+ data_loading
116
121
) ;
117
122
118
123
return contents ;
119
124
} ) ;
120
125
121
- private getContent ( active : boolean , isFocused : boolean , column : IColumn , dropdown : IDropdown | undefined , columnIndex : number , rowIndex : number , datum : any , formatters : ( ( value : any ) => any ) [ ] ) {
126
+ private getContent ( active : boolean , isFocused : boolean , column : IColumn , dropdown : IDropdown | undefined , columnIndex : number , rowIndex : number , datum : any , formatters : ( ( value : any ) => any ) [ ] , data_loading : boolean ) {
127
+
122
128
const className = [
123
129
...( active ? [ 'input-active' ] : [ ] ) ,
124
130
isFocused ? 'focused' : 'unfocused' ,
125
131
'dash-cell-value'
126
132
] . join ( ' ' ) ;
127
133
128
- const cellType = getCellType ( active , column . editable , dropdown && dropdown . options , column . presentation ) ;
134
+ const cellType = getCellType ( active , column . editable , dropdown && dropdown . options , column . presentation , data_loading ) ;
129
135
130
136
switch ( cellType ) {
131
137
case CellType . Dropdown :
@@ -136,6 +142,7 @@ class Contents {
136
142
dropdown = { dropdown && dropdown . options }
137
143
onChange = { this . handlers ( Handler . Change , rowIndex , columnIndex ) }
138
144
value = { datum [ column . id ] }
145
+ disabled = { data_loading }
139
146
/> ) ;
140
147
case CellType . Input :
141
148
return ( < CellInput
0 commit comments