fix: fixed problems with drag and drop

This commit is contained in:
overflowerror 2021-08-22 17:47:43 +02:00
parent 21c9deaa49
commit 51aa1712fd
2 changed files with 8 additions and 5 deletions

View file

@ -102,9 +102,8 @@ const AccountCard: FunctionComponent<AccountCardProps> = (
open={Boolean(editThread)}
initial={editThread ? editThread : emptyThread(account)}
onSubmit={(thread) => {
thread.tweets.forEach(t => {
t.id = undefined
})
thread = {...thread}
thread.tweets = thread.tweets.map(t => ({...t, id: undefined}))
const endpoint = new ThreadEndpoint(client)
const onSuccess = (result: Thread) => {

View file

@ -59,7 +59,7 @@ const Index: FunctionComponent<ThreadFormProps> = (
return (
<Dialog open={open}>
<DialogTitle title={"Thread"}/>
<DialogContent>
<DialogContent style={{overflowY: "unset"}}>
<Grid container spacing={2}>
<Grid item xs={12}>
<TextField
@ -102,7 +102,11 @@ const Index: FunctionComponent<ThreadFormProps> = (
>
{
thread.tweets.map((tweet, index) => (
<Draggable draggableId={tweet.id!} index={index}>
<Draggable
draggableId={tweet.id!}
index={index}
key={tweet.id!}
>
{(provided, snapshot) => (
<Grid
container