J4 Issue ?
avatar infograf768
infograf768
21 Jul 2019

Steps to reproduce the issue

General settings to create a testable multilingual site:

  1. Languages:
    en-GB already there, install fr-FR, de-DE, fa-IR
  2. Use the multilingual sample data module in Dashboard.
  3. Switch back-end language for each language installed and use the Blog sample data module in Dashboard each time you have switched back-end language

Then load com_associations
administrator/index.php?option=com_associations&view=associations
Select articles and language, for example English (en-GB)
You will get this:
Screen Shot 2019-07-21 at 08 24 14

Click on the gray FR icon in the associations column.

Here the results depend on the browser you use
Category field:

  1. With Firefox
    Most of the time the Category field for the reference, the target or both flashes rapidly and then displays nothing.
    Screen Shot 2019-07-21 at 08 29 25
  2. With Chrome
    It works fine

Screen Shot 2019-07-21 at 08 30 50

Same problem for the Parent field when Itemtype is Category.
Screen Shot 2019-07-21 at 08 49 12

Associations tab (in fact now accordeon, see rant below)
Independant from browser, we get

Screen-Shot-2019-07-21-at-08 34 36with-redstroke

As can be seen the Target association for the reference item is wrong.

UI rant

Using Accordeon instead of tabs (as done in 3.x) makes the whole feature the less user friendly experience I have ever seen, specially as clicking on the title of each open accordeon does not close it, forcing to infinite scrolls.

Note

These issues are not present in 3.x

avatar infograf768 infograf768 - open - 21 Jul 2019
avatar joomla-cms-bot joomla-cms-bot - change - 21 Jul 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Jul 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Jul 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 21 Jul 2019
avatar Fedik
Fedik - comment - 21 Jul 2019

If I right understood it may be a bug with select field, there was a fix #23455
I try to redo, some time later.

About a Tabs that Accordion (on small window width), it hardcoded in the tabs script, that better ask a guy who wrote it ?

avatar infograf768
infograf768 - comment - 21 Jul 2019

If I right understood it may be a bug with select field, there was a fix #23455

This would explain the category and parent field issue in Firefox indeed, not sure about the wrong association field result.

avatar infograf768
infograf768 - comment - 21 Jul 2019

About a Tabs that Accordion (on small window width), it hardcoded in the tabs script, that better ask a guy who wrote it

No idea who wrote the custom-elements: the js is in media/vendor/joomla-custom-elements/js/joomla-tab.js I would not even know who to ask. ROTFLOL

Maybe @wilsonge knows

avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Jul 2019
Status New Discussion
avatar richard67
richard67 - comment - 21 Jul 2019

@infograf768 It was @dgrammatiko , as far as I know.

avatar brianteeman
brianteeman - comment - 21 Jul 2019

Using Accordeon instead of tabs (as done in 3.x) makes the whole feature the less user friendly experience I have ever seen, specially as clicking on the title of each open accordeon does not close it, forcing to infinite scrolls.

Maybe thats another firefox bug as they do work correctly as an accordion for me on chrome (not commenting about tabs vs accordion

avatar dgrammatiko
dgrammatiko - comment - 21 Jul 2019

@infograf768 I was the one that wrote that script. Unfortunately, there was a request from the accessibility team to have an automatic transformation from tabs to accordion for mobiles. This:

  • was very poorly/badly (put whatever word you like here) by me
  • is wrong to have such changes based on the window width
  • script used to reveal the wrong implementation of many custom elements (that's the reason it wasn't fixed for so long)

Most of the fields are NOT production ready. Months ago I tried to fix that but for some reason, @wilsonge was not merging those PRs, so, you end up with really buggy interactive elements. Of course, solving the tabs it might seem the problem here but the reality is that the fields need to be fixed before that

avatar Fedik
Fedik - comment - 21 Jul 2019

@infograf768 please test #25676 , it a fix only for an empty category/parent/tags field

avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Jul 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-07-21 14:13:42
Closed_By franz-wohlkoenig
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 21 Jul 2019

Closed as having Pull Request #25676

avatar franz-wohlkoenig franz-wohlkoenig - close - 21 Jul 2019
avatar Fedik
Fedik - comment - 21 Jul 2019

@franz-wohlkoenig it an partial fix for the issue, it does not fix:

Target association for the reference item is wrong.

avatar richard67
richard67 - comment - 21 Jul 2019

@franz-wohlkoenig As far as I understood Fedik, his PR fixes only a part of the issues mentioned here.

avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Jul 2019
Status Closed New
Closed_Date 2019-07-21 14:13:42
Closed_By franz-wohlkoenig
avatar franz-wohlkoenig franz-wohlkoenig - reopen - 21 Jul 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Jul 2019
Status New Discussion
avatar infograf768
infograf768 - comment - 21 Jul 2019

#25676 works fine for Category, Parent and Tab. ? @Fedik

Notes

The Target Association field for its reference is not solved (as it is not concerned by #25676).

Accordion can't be toggled by clicking on its title in Firefox AND Chrome, as I wrote above.

avatar infograf768
infograf768 - comment - 21 Jul 2019

Another Note:
Now that #25676 is OK and we can see the category, there is another bug on wide screens:
Screen Shot 2019-07-21 at 17 56 44

Maybe we should force here display with tabs or accordion for these parameters (once accordion toggling is solved)

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 21 Jul 2019

shouldn't that be own Issues so we get one Issue = one PR?

avatar infograf768
infograf768 - comment - 21 Jul 2019

shouldn't that be own Issues so we get one Issue = one PR?

Yep. Was just a Note. Once #25676 is merged I will create 2 new issues: one for the association field, the other for the Accordion stuff (in which I will copy @dgrammatiko post here.

avatar brianteeman
brianteeman - comment - 21 Jul 2019

I have now tested the accordion in firefox and can confirm it works (opens just one at a time) as well as in chrome

avatar infograf768
infograf768 - comment - 21 Jul 2019

I have now tested the accordion in firefox and can confirm it works (opens just one at a time) as well as in chrome

It does NOT toggle when clicking on the "opened accordeon" title which means it never closes except if you click on another accordion title. I never said we can't get the accordeon to open.

avatar brianteeman
brianteeman - comment - 21 Jul 2019

That would collapse all? Its not supposed to do that

avatar infograf768
infograf768 - comment - 21 Jul 2019

I am expecting the same behavior as in 3.x for accordeons. Anyhting else is unacceptable.

accordeontoggle

It is specially important here because of the amount of parameters and accordeons

avatar brianteeman
brianteeman - comment - 21 Jul 2019

unacceptable is a very strong term

avatar dgrammatiko
dgrammatiko - comment - 21 Jul 2019

The accordion was designed like that. Eg if you click on an active tab list element the tab doesn’t disappear, thus the accordion follows the same pattern. This accordion shouldn’t be compared to the bootstrap one! At least this one is properly accessible...

avatar infograf768
infograf768 - comment - 21 Jul 2019

Sorry to say. This is bad design. Anyone trying to work with accordions in multilang associations will soon give up.
Do you really need an animated gif to demonstrate what a user is forced to do?

avatar dgrammatiko
dgrammatiko - comment - 21 Jul 2019

Just for the record: all bootstrap interactive components are crap comparing to the accessibility guides from w3c. This was the main reason joomla decided to roll its own. The vanilla js and custom elements where side effects of that reason...

Just because you were used to some wrong pattern the switch to the correct one cannot be noted as unacceptable...

avatar infograf768
infograf768 - comment - 21 Jul 2019

accordeons

avatar dgrammatiko
dgrammatiko - comment - 21 Jul 2019

@infograf768 what you're showing us with this gif is not something broken. What I believe you would like, but you're not asking for it rather just blaming, is some kind of synchronization of the 2 iframes, eg when you activate one tab on one pane the same tab activates in the other pane.

It'snot the accordion/tab that is wrong in this particular failed design, think about it...

avatar infograf768
infograf768 - comment - 21 Jul 2019

Nope, we need collapse more than sync.

avatar dgrammatiko
dgrammatiko - comment - 21 Jul 2019

Sorry I don't agree and obviously since I disagree I won't code such thing

avatar brianteeman
brianteeman - comment - 21 Jul 2019

There is nothing that says you cannot have accessible accordion exactly how @infograf768 wants it

Read https://www.scottohara.me/blog/2017/10/25/accordion-release.html
and see the examples https://scottaohara.github.io/a11y_accordions/

avatar dgrammatiko
dgrammatiko - comment - 21 Jul 2019

@brianteeman I didn't say that it is wrong, did I? The script, though, has the same functionality for tabs and accordion for simplicity. Adding this kind of behaviour will need more code. The point IMHO is that the automatic transformation from tabs to accordion (although might sound a very nice UX) shouldn't have been implemented in the first place.

avatar brianteeman
brianteeman - comment - 21 Jul 2019

I dont have an opinion on that

avatar infograf768
infograf768 - comment - 22 Jul 2019

I have nothing against changing tabs to accordion. It looks like an excellent feature when the window is reduced (and essential for non-desktop screens).
This is also used when editing any item (for example an article) and not only for com_associations side by side.
The only issue with the current implementation is the absence of collapsing forcing users to scroll and scroll and scroll.
I insist this is bad UI and as it can be implemented (#25672 (comment) tks for link) without giving up accessibility, I see no good reason to not correct it.

avatar Fedik
Fedik - comment - 22 Jul 2019

just a thought,
in theory, alternative for accordion transformation could be a tabs with "icon+text", which on mobile shows only "icon" (icon+text for active tab)

avatar dgrammatiko
dgrammatiko - comment - 22 Jul 2019

@Fedik check how tabs work on this exact site for mobiles (hint: the tab links become horizontal scrollable, thus no need to shrink to icons)

avatar infograf768
infograf768 - comment - 25 Jul 2019

Closing this.
Further tests show that the association field issue is older than 4.0. Asked Robbie for help on this.
As for the accordion... not much more to say about it. If the original coder of that js does not admit the issue and nobody is willing/knowing how/proposing to correct it, it will remain as part of the wrong UI(s) of J4.

avatar infograf768 infograf768 - change - 25 Jul 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-07-25 06:33:35
Closed_By infograf768
avatar infograf768 infograf768 - close - 25 Jul 2019
avatar brianteeman
brianteeman - comment - 25 Jul 2019

Create a new issue for the accordion. Its a generic issue not just related to associations. Should be an easy fix - but not if its buried here

avatar dgrammatiko
dgrammatiko - comment - 25 Jul 2019

@infograf768 fwiw all my work was based on this: https://w3c.github.io/aria-practices/examples/accordion/accordion.html and as you can see the functionality you’re missing is not there as well

avatar infograf768
infograf768 - comment - 25 Jul 2019

@dgrammatiko
Screen Shot 2019-07-25 at 11 50 07

Screen Shot 2019-07-25 at 11 43 14

and from the sample accordeon.js

  // Allow for each toggle to both open and close individually
  var allowToggle = (allowMultiple) ? allowMultiple : accordion.hasAttribute('data-allow-toggle');

and further down

        // When toggling is not allowed, clean up disabled state
        if (!allowToggle) {
          active.removeAttribute('aria-disabled');
        }

and

        // If toggling is not allowed, set disabled state on trigger
        if (!allowToggle) {
          target.setAttribute('aria-disabled', 'true');
        }
 else if (allowToggle && isExpanded) {
        // Set the expanded state on the triggering element
        target.setAttribute('aria-expanded', 'false');
        // Hide the accordion sections, using aria-controls to specify the desired section
        document.getElementById(target.getAttribute('aria-controls')).setAttribute('hidden', '');
      }

The example provided indeed does not set aria-disabled to false, but it looks available in the code if desired.
Screen Shot 2019-07-25 at 12 03 31

Using this could solve the issue if I do not mistake.
But as joomla-tab.js is a mixture of tabs and accordion, I have no idea how to do that myself.

avatar infograf768
infograf768 - comment - 25 Jul 2019

Btw, aria-disabled= "false" is used by https://scottaohara.github.io/a11y_accordions/

Add a Comment

Login with GitHub to post a comment