File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
themes/bootstrap5/templates/_ui/components Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1313 * @param string $toggleLabel The label for the toggle button (will be translated)
1414 * @param ?string $wrapperTag Tag to use as a wrapper around the control (default = div)
1515 * @param ?string $wrapperClass Extra CSS class(es) to apply to the wrapper tag
16+ * @param ?string $menuAlign Alignment of the drop-down. Default is alignment with the start side of its parent.
17+ * 'end' aligns with the end side of its parent.
1618 */
1719 $ wrapperTag = $ this ->wrapperTag ?? 'div ' ;
1820 $ wrapperClass = 'dropdown ' ; // Bootstrap class
5254 )
5355 ?>
5456
55- <ul class="dropdown-menu">
57+ <?php
58+ $ menuAttributes = $ this ->htmlAttributes (['class ' => 'dropdown-menu ' ]);
59+ if ('end ' == ($ this ->menuAlign ?? null )) {
60+ $ menuAttributes ->add ('class ' , 'dropdown-menu-end ' );
61+ }
62+ ?>
63+ <ul<?= $ menuAttributes?> >
5664 <?php foreach ($ this ->menuItems as $ current ): ?>
5765 <li class="dropdown__item">
5866 <a class="dropdown-item dropdown__link<?= ($ current ['selected ' ] ?? false ) ? ' active ' : '' ?> "
You can’t perform that action at this time.
0 commit comments