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

Blocks field: fix empty display #6951

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

distantnative
Copy link
Member

@distantnative distantnative commented Jan 25, 2025

Description

Summary of changes

The blocks field is currently glitchy when showing the empty placeholder. As it so far relies on data-empty attribute, it still gets shown even when a block from another blocks field is moved over (as it technically is only the sortable ghost and not present yet in the blocks data array).

This PR tries to solve this rather by utilizing CSS :empty and :has() to decide when the .-k-blocks-list is truly empty of blocks but also sortable ghosts and spending on that show/hide the empty placeholder.

With this change (and the previous sortable change), the ancient #5290 seems to be solved.

Additional context

I didn't run into any errors with this last state. But would feel better if @afbora hits it hard with your bug finding skills.

Changelog

Fixes

  • Blocks field: drag & drop between different blocks fields now functional

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and CI checks all pass

For review team

  • Add lab and/or sandbox examples (wherever helpful)
  • Add changes & docs to release notes draft in Notion

@distantnative distantnative added this to the 5.0.0-beta.3 milestone Jan 25, 2025
@distantnative distantnative self-assigned this Jan 25, 2025
@distantnative distantnative linked an issue Jan 25, 2025 that may be closed by this pull request
@distantnative distantnative marked this pull request as ready for review January 25, 2025 09:43
@distantnative distantnative requested a review from a team January 25, 2025 09:43
Copy link
Member

@afbora afbora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, looks like works great 🎉

@bastianallgeier bastianallgeier merged commit 83dcb7c into v5/develop Jan 27, 2025
4 checks passed
@bastianallgeier bastianallgeier deleted the v5/fix/blocks-field-move-empty branch January 27, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Drag'n'drop between block fields broken
3 participants