Skip to content

Fix outdated flash component example in docs#6631

Merged
SteffenDE merged 1 commit intophoenixframework:mainfrom
eagle-head:fix/flash-example-doc
Mar 20, 2026
Merged

Fix outdated flash component example in docs#6631
SteffenDE merged 1 commit intophoenixframework:mainfrom
eagle-head:fix/flash-example-doc

Conversation

@eagle-head
Copy link
Contributor

The flash component @doc example used show("#flash") which had two issues:

  1. The id #flash does not match the default generated id (flash-#{kind})
  2. The flash was missing the hidden attribute, so phx-mounted had no visible effect

Updated the example to follow the same pattern used by the client-error and
server-error flashes in the generated layouts: explicit id, hidden attribute,
and show("#id") |> JS.remove_attribute("hidden").

Closes #6624

The example used `show("#flash")` which does not match the default
generated id (`flash-#{kind}`), and was missing the `hidden` attribute
needed for `phx-mounted` to work correctly.

Updated to follow the same pattern used by the server-error and
client-error flashes in the generated layouts.

Closes phoenixframework#6624
@SteffenDE SteffenDE merged commit ef11892 into phoenixframework:main Mar 20, 2026
@SteffenDE
Copy link
Contributor

🙌

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.

Should the flash example be corrected?

2 participants