creativeorange / craft-article

Edit richt text content in Craft CMS using Article by Imperavi.
Other
7 stars 3 forks source link

Failed to execute 'matches' on 'Element' #27

Closed espensgr closed 8 months ago

espensgr commented 8 months ago

Started getting an error in console that make the module crash:

Uncaught DOMException: Failed to execute 'matches' on 'Element': '.grid.grid-cols-2.md:grid-cols-6.lg:grid-cols-12.gap-4' is not a valid selector.

Seems to come from the https://cdn.creativeorange.eu/article/2.4.x/article-editor.js file. And it seems to only trigger when Grid is added.

Running version v1.1.1 on Craft CMS 3.9.11

espensgr commented 8 months ago

This seems to be an error on our setup long ago, we have a custom css with grid classname from tailwindcss with media queries classes, and that dont parse well in the match class function in js:

"grid": {
    "classname": "grid grid-cols-2 md:grid-cols-6 lg:grid-cols-12 gap-4",
    ...

So we are going to replace the classname and do a search and replace in the database.

So for anyone else this may concern, make a custom classname than contains mediaqueries.