Skip to content

Commit a20b33a

Browse files
authored
Adjusted dropdown button behavior in form_theme template (#124)
| Q | A | --------------- | ----- | Bug fix? | yes | New feature? | no | BC breaks? | no/yes | Related tickets | #120 | License | MIT An attribute on an element that does not contain other elements, and the script below requires that the dropdown target be contained within an element with the toggle attribute. ```js countErrors(element) { const elementTarget = this.element.querySelector(element.getAttribute('data-bs-target')); return elementTarget.querySelectorAll('.is-invalid').length + elementTarget.querySelectorAll('.alert-danger').length; } ```
2 parents fad2c31 + ce779e1 commit a20b33a

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ jobs:
7878
name: Output PHP version for Symfony CLI
7979
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version
8080

81-
-
82-
name: Install certificates
83-
run: symfony server:ca:install
84-
8581
-
8682
name: Get Composer cache directory
8783
id: composer-cache

behat.yaml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ default:
1313

1414
Behat\MinkExtension:
1515
files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/"
16-
base_url: "https://127.0.0.1:8080/"
16+
base_url: "http://127.0.0.1:8080/"
1717
default_session: symfony
1818
javascript_session: chrome
1919
sessions:

templates/admin/shared/component_elements/form_theme.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
{% block add_button_row %}
2626
{% if types is not empty %}
27-
<div class="dropdown" {{ sylius_test_html_attribute('add-element-button') }}>
28-
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown">{{ label|trans }}</button>
27+
<div class="dropdown" data-bs-toggle="dropdown" {{ sylius_test_html_attribute('add-element-button') }}>
28+
<button class="btn dropdown-toggle" type="button">{{ label|trans }}</button>
2929
<ul class="dropdown-menu">
3030
{% for type, label in types %}
3131
<li>

0 commit comments

Comments
 (0)