yard77/laravel-tachyon

Adding "page_speed_X" attribute breaks class attribute for AlpineJS

Closed this issue ยท 0 comments

๐Ÿ”Ž Context
When using the package, classes of type page_speed_... are added to the start of relevant elements, but in doing so, class attribute is being replaced by :class. This breaks AlpineJS, as it recognises resulting :class as an x-bind directive, which it obviously isn't. Also, the original :class attribute is replaced if present.

๐Ÿ”ข Steps to reproduce

  1. Enable usage of the package in the project.
  2. Use class attribute on element inside other element containing x-data.
  3. Try to enter the page.

๐Ÿ‘ Expected behaviour
class attribute will only get page_speed_... appended to it, enabling speed-up.

๐Ÿ‘Ž Resulting behaviour
class attribute C is replaced with :class one, removing both original C and correct :class one if present.