Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): correctly show blocks after blocksDrawer close #10847

Merged

Conversation

akhrarovsaid
Copy link
Contributor

@akhrarovsaid akhrarovsaid commented Jan 28, 2025

What?

This PR fixes an issue where after closing the BlocksDrawer component after performing a search, stale Blocks were shown the next time it was open.

Why?

To properly show all blocks when the BlocksDrawer is open after being closed with a filtered search.

How?

The BlocksDrawer was simply checking the existence of the isModalOpen function instead of calling it as expected.

Fixes #10843

Before:
https://github.com/user-attachments/assets/5f41012d-ca84-41b4-9861-d5e0cb2579f6

After:
Editing---Block-Field-after--Payload.webm

@PatrikKozak
Copy link
Contributor

Hey @akhrarovsaid - thank you!

Looks good to me, I went ahead and added a test for this - will merge once CI passes.

Good work!

@PatrikKozak PatrikKozak self-requested a review January 28, 2025 17:24
@PatrikKozak PatrikKozak merged commit 8a6d995 into payloadcms:main Jan 28, 2025
67 checks passed
@fturmel
Copy link
Contributor

fturmel commented Jan 28, 2025

Thank you both!

@akhrarovsaid akhrarovsaid deleted the fix/blocksdrawer-stale-matchedblocks branch January 28, 2025 19:13
Copy link
Contributor

🚀 This is included in version v3.20.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blocks picker/drawer search state doesn't reset properly on re-open
3 participants