Split Button doesn't refresh correctly after query success

I am following Retool tutorials

I've modified the Block button state to hidden when the user is already blocked.

However, even after successful execution of blockUser query, the Block option is still available and I am able to re-execute the query.

btn2

Update - Even after modifying the click handler to ensure that Block query only runs when user is unblocked, I am still able to retrigger the query through the block button

Hey tj11,

Do you mind sharing the blockUser query?

What might be the case here is that once you block an user - you need to on success refresh the query that loads the table so the new value is reflected.

Hi stefan,

I am calling getUsers on successful execution of blockUser.

get

Hey tj11,

After building a demo app it seems like this is a bug where if you switch selected row and then go back to the one you edited it will update the button. However, if you stay on the current row the split button doesn't re-evaluate.

You can work around this behavior by selecting a different row on the table or clearing selection on success.

@Tess this seems like a bug and it would be useful if we could Reset/Clear value of split button component as the only options available are Set Hidden/Set Disabled/Scroll into View.

Hey @stefancvrkotic, thank you for tagging us in here and for reproducing this bug with @tj11 (and thank you for reporting this in the first place)!

Filed a bug for this and will keep this thread updated :+1:

Update! selectedRow now updates when the underlying data changes :slight_smile: This fix should go live shortly this week. Thank you all for reporting + testing here.

1 Like