contao / contao

Contao Open Source CMS
https://contao.org
GNU Lesser General Public License v3.0
350 stars 159 forks source link

js_autofocus no longer works for comments #4239

Closed Aybee closed 2 years ago

Aybee commented 2 years ago

Affected version(s)

4.13.0

Description

The CSS class no longer is named "confirm" now it's named "tl_confirm".

https://github.com/contao/contao/blob/5.x/core-bundle/src/Resources/contao/templates/js/js_autofocus.html5#L4

You can extend this line in above template this way, then it will work again.

    var p = document.querySelector('p.error') || document.querySelector('p.confirm') || document.querySelector('p.tl_confirm');
leofeyer commented 2 years ago

The JS is correct; the template should not assign the class tl_confirm.

fritzmg commented 2 years ago

Seems to have changed in Contao 4.2.1: https://github.com/contao/contao/commit/15eed8462da160035afb019da026204eb2b23977

leofeyer commented 2 years ago

Strange. We usually only use .tl_ classes in the back end, so it should have been .confirm in those templates.

fritzmg commented 2 years ago

Yes, I think the change was made erroneously. So all these templates should use confirm and the JavaScript can stay as is.

Aybee commented 2 years ago

Thanks 👍