Skip to content

Trouble rendering a modal dialog that uses a signal #3045

Closed Answered by gbj
jacklund asked this question in Q&A
Discussion options

You must be logged in to vote

There are two separate issues here:

  1. This is not reactive, because it's not a function:
{
    let mut rows = vec![];
    for index in 0..count.get() {
        let types = datatypes.clone();
        rows.push(view! { <AttributeRow datatypes=types index=index/> });
    }
    rows
}

I'm not sure which version you're using but there should be a warning in the browser console that actually points to 0..count.get() here.

{move || { let mut rows /* ... */ works, and see the Iteration chapter.

  1. Clicking a <button> inside a <form> has a default behavior. In this case, clicking a button inside a form inside a dialog seems to have the default behavior of closing the dialog. You can prevent this by …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by jacklund
Comment options

You must be logged in to vote
2 replies
@gbj
Comment options

@jacklund
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants