Skip to content

Commit

Permalink
Fix overlapping of action confirmation modals IDs on actions with the…
Browse files Browse the repository at this point in the history
… same name, but different context
  • Loading branch information
Kreyu committed Jan 12, 2025
1 parent 2207676 commit 275577d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Action/Type/ActionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ public function buildView(ActionView $view, ActionInterface $action, array $opti

if ($action->getConfig()->isConfirmable()) {
$options['confirmation']['identifier'] = vsprintf(
format: '%s-action-confirmation-%s',
format: '%s-%s-action-confirmation-%s',
values: [
$dataTable->vars['name'],
$action->getConfig()->getContext()->value,
$action->getName(),
],
);
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/themes/bootstrap_5.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@
{% set attr = {
'class': 'btn btn-primary dropdown-toggle',
'type': 'button',
'id': data_table.vars.name ~ '--row-action--' ~ name ~ '--button',
'id': data_table.vars.name ~ '--' ~ context.value ~ '-action--' ~ name ~ '--button',
'aria-expanded': 'false',
'data-bs-toggle': 'dropdown',
}|merge(attr) %}
Expand Down

0 comments on commit 275577d

Please sign in to comment.