b13 / collapse

Collapse or expand Content Element in TYPO3's Page Module
GNU General Public License v2.0
3 stars 5 forks source link

Sometimes all elements are collapsed by default, unable to change state #11

Open sypets opened 5 months ago

sypets commented 5 months ago

Update: Problem might be due to using outdated browser. So, better alternative might be updating browser. See compat. matrix: https://developer.mozilla.org/en-US/docs/Web/API/Element/ariaExpanded#browser_compatibility


It has been reported at least twice since extension was activated. At first I could not reproduce it, but after switching browser from Chromium to Firefox, I could.

It was reported that all elements were collapsed. It was possible to expand individual elements, but after reloading the page, the behaviour was the same (all elements collapsed).

Overrall, we saw 2 different problems:

  1. when element was collapsed, this was not saved. Looks similar to #1 and #7 and seemed to be fixed with #10
  2. (this issue) all elements collapsed, not possible to change behaviour. Depends on Browser

I will create PR.

Possible solution

changing

- if (btn.ariaExpanded == 'true') {
+ if (btn.getAttribute('aria-expanded') == 'true') {

in PageModuleCollapse.js

was reported to work.

Info

Behaviour may be browser-dependant, see also

Versions

reproduced with

Note: I usually do not use Firefox, this might be an outdated version. The other colleagues are usually under Windows using automatically updated versions.