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

Update docs mentioning a unique id for an empty state in a stream #3707

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Aratramba
Copy link

@Aratramba Aratramba commented Mar 6, 2025

Currently the docs do not mention that you need an id when adding an empty state inside the stream DOM element. It is added in the code example.

This PR updates the wording above the example.

Reasoning

When the stream is updated the empty state will be added multiple times if it does not have an id. Therefore the :only selector will not work. Makes perfect sense, but it would be good to call it out in the docs.

Example

if you forget to add the ID here it will not work

<tbody id="songs" phx-update="stream">
-  <tr class="only:block hidden">
 + <tr id="songs-empty" class="only:block hidden">
      <td colspan="2">No songs found</td>
  </tr>
</tbody>

add comment mentioning a unique id for the empty state
@Aratramba Aratramba changed the title Add comment mentioning a unique id for an empty state in a stream Update docs mentioning a unique id for an empty state in a stream Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant