File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/packages/frontend/editors/task-editor Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export default function TaskList({
70
70
const virtuosoRef = useRef < VirtuosoHandle > ( null ) ;
71
71
const [ visible , setVisible ] = useState < List < string > > ( visible0 ) ;
72
72
useEffect ( ( ) => {
73
- setVisible ( visible ) ;
73
+ setVisible ( visible0 ) ;
74
74
} , [ visible0 ] ) ;
75
75
76
76
const selectedHashtags : Set < string > = useMemo ( ( ) => {
@@ -174,7 +174,9 @@ export default function TaskList({
174
174
let visible1 = visible . delete ( oldIndex ) ;
175
175
visible1 = visible1 . insert ( newIndex , visible . get ( oldIndex ) ! ) ;
176
176
setVisible ( visible1 ) ;
177
- actions ?. reorder_tasks ( oldIndex , newIndex ) ;
177
+ // must set visible0 (in the store) in next render loop, or the above
178
+ // gets combined with this and there is flicker.
179
+ setTimeout ( ( ) => actions ?. reorder_tasks ( oldIndex , newIndex ) , 1 ) ;
178
180
} }
179
181
>
180
182
< div
You can’t perform that action at this time.
0 commit comments