File tree Expand file tree Collapse file tree 1 file changed +17
-15
lines changed
frameworks/keyed/million/src Expand file tree Collapse file tree 1 file changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -129,31 +129,33 @@ const swapRows = () => {
129
129
let prevBlock ;
130
130
131
131
const select = ( id ) => {
132
+ if ( prevBlock ) {
133
+ if ( prevBlock . props . id === id ) return ;
134
+ const { id : prevId , label } = prevBlock . props ;
135
+ const row = Row (
136
+ {
137
+ id : prevId ,
138
+ label,
139
+ className : '' ,
140
+ } ,
141
+ String ( id )
142
+ ) ;
143
+ row . memo = [ label , false ] ;
144
+ prevBlock . patch ( row ) ;
145
+ }
132
146
const block = main . children . find ( ( block ) => block . props . id === id ) ;
147
+ const { label } = block . props ;
133
148
const row = Row (
134
149
{
135
150
id,
136
- label : block . props . label ,
151
+ label,
137
152
className : 'danger' ,
138
153
} ,
139
154
String ( id )
140
155
) ;
141
- row . memo = [ block . props . label , true ] ;
156
+ row . memo = [ label , true ] ;
142
157
block . patch ( row ) ;
143
158
144
- if ( prevBlock ) {
145
- const row = Row (
146
- {
147
- id : prevBlock . props . id ,
148
- label : prevBlock . props . label ,
149
- className : '' ,
150
- } ,
151
- String ( prevBlock . props . id )
152
- ) ;
153
- row . memo = [ prevBlock . props . label , false ] ;
154
- prevBlock . patch ( row ) ;
155
- }
156
-
157
159
prevBlock = block ;
158
160
} ;
159
161
You can’t perform that action at this time.
0 commit comments