Conversation
|
Main example Capture.video.du.2026-04-20.08-41-21.mp4 |
|
Basic example Capture.video.du.2026-04-20.08-42-25.mp4 |
|
Align example Capture.video.du.2026-04-20.08-47-25.mp4 |
|
With form example Capture.video.du.2026-04-20.08-53-15.mp4 |
|
RTL example Capture.video.du.2026-04-20.09-01-46.mp4 |
7129082 to
d55e111
Compare
There was a problem hiding this comment.
By doing this, you are forcing the user to use a button like as a trigger, this is not our philosophy.
Please check the existing *Trigger.html.twig, they are nearly-empty templates that expose a Twig variable ..._trigger_attrs, e.g. with AlertDialog/Trigger.html.twig:
{# @block content The trigger element (e.g., a `Button`) that opens the dialog when clicked #}
{%- set alert_dialog_trigger_attrs = {
'data-action': 'click->alert-dialog#open'|html_attr_type('sst'),
'data-alert-dialog-target': 'trigger',
'aria-haspopup': 'dialog',
'aria-expanded': 'false',
} -%}
{%- block content %}{% endblock -%}Usage:
<twig:AlertDialog id="delete_account">
<twig:AlertDialog:Trigger>
<twig:Button variant="outline" {{ ...alert_dialog_trigger_attrs }}>
Show Dialog
</twig:Button>
</twig:AlertDialog:Trigger>
<twig:AlertDialog:Content>...</twig:AlertDialog:Content>
</twig:AlertDialog>
It also means that you must not use details and summary HTML elements.
Thanks!
Follow up on the review feedback on symfony#3487: the Trigger template should not enforce a specific HTML element but expose a Twig variable with the needed attributes so the consumer can pick their own element (button, link, span...).
Follow up on the review feedback on symfony#3487: the Trigger and SubTrigger templates should not enforce a specific HTML element but expose a Twig variable with the needed attributes so the consumer can pick their own element.
Follow up on the review feedback on symfony#3487: the Trigger template should not enforce a specific HTML element but expose a Twig variable with the needed attributes so the consumer can pick their own element.
Follow up on the review feedback on symfony#3487: the Trigger template should not enforce a specific HTML element but expose a Twig variable with the needed attributes so the consumer can pick their own element (button, link, span...). Since the previous implementation relied on native `<details>`/`<summary>` to handle open/close, replace it with a `<div>` backed by a new `popover_controller.js` Stimulus controller that handles toggle, outside click, escape and mutual exclusion by `name`. Also drop two orphan snapshots (`Demo.html__1.html`, `Usage.html__1.html`) shipped by mistake and no longer generated by the test suite.
|
Reworked to apply the |
Follow up on the review feedback on symfony#3487: the Trigger template should not enforce a specific HTML element but expose a Twig variable with the needed attributes so the consumer can pick their own element (button, link, span...). Since both `Drawer` and `Sheet` relied on native `<details>`/`<summary>` to handle open/close, replace them with `<div>`s backed by small `drawer_controller.js` and `sheet_controller.js` Stimulus controllers handling toggle, outside click and escape. Also drop four orphan snapshots (`Demo.html__1.html`, `Usage.html__1.html` for both kits) shipped by mistake and no longer generated by the test suite.
Follow up on the review feedback on symfony#3487: the Trigger template should not enforce a specific HTML element but expose a Twig variable with the needed attributes so the consumer can pick their own element (button, link, span...). Since `DropdownMenu` relied on native `<details>`/`<summary>` to handle open/close, replace it with a `<div>` backed by a new `dropdown_menu_controller.js` Stimulus controller handling toggle, outside click and escape. Convert `SubTrigger` to the same convention (drop the hardcoded `<button>`/chevron; consumer now picks the wrapping element and adds the chevron). Migrate `Sub`/`SubContent` from the `peer/peer-hover` pattern to `group/group-hover` so the sub-menu still opens on hover once the peer anchor moves out of the template. Also drop two orphan snapshots (`Demo.html__1.html`, `Usage.html__1.html`) shipped by mistake and no longer generated by the test suite.
Follow-up of symfony/ux#3487: the Popover recipe now ships a Stimulus controller, register it in the toolkit-shadcn entrypoint and add the corresponding importmap entry so examples on this docs page work interactively.
|
Re-tested locally on ux.symfony.com (with the matching controller registration on symfony/ux.symfony.com#70) — open/close, outside click and escape all behave as expected on every example (Demo / Usage / Basic / Alignments / Form / RTL). Back to ready for review. 🙌 |
Adds the
popoverrecipe to the Shadcn kit.Part of the split of #3468 into one PR per component, tracking #3233.
Snapshots will be regenerated after rework.