- Issue created by @hudri
- 🇦🇹Austria hudri Austria
I've been digging:
core.libraries.yml
drupal.autocomplete: css: component: assets/vendor/jquery.ui/themes/base/core.css: { weight: -11.8 } drupal.dialog: css: component: assets/vendor/jquery.ui/themes/base/core.css: { weight: -11.8 }
- My taxonomy term pages load with dialog, but without autocomplete.
- Pressing the upload button triggers an Ajax request, the the autocomplete library is added.
- The Ajax request from the autocomplete library attaches the same base CSS file again, but at the very end of the page, bypassing the weight of the files.
This seems to be a reproduceable core bug. Drupal can prevent the double loading of libraries, but it can not prevent two libs from loading the same file.
When two libs load the same file, and one of them is an ajax requests, this totally bypasses all ordering from weights and SMACSS layers. IMHO core should refactor the remaining jQuery libs: Move shared files into a separate library, and then both dialog and autocomplete must depend on the new shared lib.
Move ticket to core project?
- Status changed to Postponed
over 1 year ago 4:54pm 14 September 2023 - 🇦🇹Austria hudri Austria
Found the corresponding core issue. Postponded because merging #3382447 should fix this.
- Status changed to Closed: works as designed
over 1 year ago 10:49am 17 September 2023 - 🇨🇭Switzerland saschaeggi Zurich
@hudri closing as works as designed as 🐛 Libraries using jquery_ui assets directly shouldn't duplicate files Fixed has been merged and it was a core issue.