Feature No Code Attached Yet a11y ?
avatar crystalenka
crystalenka
28 Oct 2022

This is a usability bug. Technically it's working as designed, but it could be easier and less frustrating.

Steps to reproduce the issue

These steps talk about custom fields, but it also applies to the core subform field.

  1. Create 5 custom fields, set to subform only. (Alternatively: only two custom fields, and one of them is an editor field.)
  2. Create a subform custom field and add all custom fields to the subform. Make sure repeatable is set to yes.
  3. Navigate to an article where you can edit the subform custom field.
  4. Add 2-3 rows.
  5. Try to reorder the rows.

Expected result

You can clearly see where the row started and where you are putting it in the context of other rows.

Actual result

So. Much. Green. You cannot always clearly see where things are going or where you started, or drag it into positions that are not visible on the screen.

System information (as much as possible)

N/A, this has been an issue for a while.

Additional comments

A possible solution is collapsing rows into "ghost" representative rows while dragging so you can see more at once, and using a more minimal drop indicator instead of a full-height item.

This happens even when you don't have too many fields, especially if one of the fields is an editor field or an accessible media field, so it's not necessarily a matter of too many sub fields in a row.

avatar crystalenka crystalenka - open - 28 Oct 2022
avatar joomla-cms-bot joomla-cms-bot - change - 28 Oct 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 Oct 2022
avatar brianteeman
brianteeman - comment - 28 Oct 2022

I was thinking exactly this as I read the problem. Never seen it in the wild but it would solve the ux

A possible solution is collapsing rows into "ghost" representative rows while dragging so you can see more at once, and using a more minimal drop indicator instead of a full-height item.

avatar crystalenka
crystalenka - comment - 28 Oct 2022

I was thinking exactly this as I read the problem. Never seen it in the wild but it would solve the ux

A possible solution is collapsing rows into "ghost" representative rows while dragging so you can see more at once, and using a more minimal drop indicator instead of a full-height item.

There is something like it shown here:
https://uxdesign.cc/drag-and-drop-for-design-systems-8d40502eb26d

I also think I have seen it in the wild but can't recall where.

avatar brianteeman
brianteeman - comment - 28 Oct 2022

looks like its quite simple to do using the dragula library we have.

avatar crystalenka
crystalenka - comment - 28 Oct 2022

Yes, but subforms appear not to be using dragula from what I can tell. (I'm not sure why.)

avatar brianteeman
brianteeman - comment - 28 Oct 2022

?

avatar crystalenka
crystalenka - comment - 28 Oct 2022

@wilsonge @dgrammatiko do you all know why this is using it's own thing instead of dragula? It looks like it was like this in j3 but not sure when dragula was introduced.

Would there be any problems in refactoring this to use dragula?

avatar crystalenka
crystalenka - comment - 28 Oct 2022

Actually, after poking around Dragula I can see that it's not accessible and has no keyboard support. :( bevacqua/dragula#538

Every issue I open gets more complicated than I intend ?

avatar dgrammatiko
dgrammatiko - comment - 29 Oct 2022

@crystalenka check #19184 (comment) and maybe follow the whole conversation in that PR. The JS-group was aware of all the issues back in 2017 but I guess 2-3 people were not enough to do the mammoth task of dropping jQuery and making everything accessible. BTW Dracula seems to be abandoned (same goes for the shopify draggable)

avatar crystalenka
crystalenka - comment - 31 Oct 2022

@crystalenka check #19184 (comment) and maybe follow the whole conversation in that PR. The JS-group was aware of all the issues back in 2017 but I guess 2-3 people were not enough to do the mammoth task of dropping jQuery and making everything accessible. BTW Dracula seems to be abandoned (same goes for the shopify draggable)

I understand. Me opening issues to address things doesn't discount the hard work done before. Just trying to make it better. :)

This seems to be the most complete answer to accessible drag and drop, and it's based on dragula: https://github.com/schne324/dragon-drop

However both this and dragula seem like they are no longer maintained.

avatar crystalenka
crystalenka - comment - 31 Oct 2022

This is also an excellent resource and the up/down arrows available make it easier too for people with limited mobility in their hands: https://www.darins.page/articles/designing-a-reorderable-list-component

avatar brianteeman
brianteeman - comment - 31 Oct 2022

However both this and dragula seem like they are no longer maintained.

Not updated doesn't necessarily = not maintained

avatar dgrammatiko
dgrammatiko - comment - 31 Oct 2022

Not updated doesn't necessarily = not maintained

Brian, I know the difference and I'll say again that the project is not maintained. You can see the efforts to bring it back to life from Lea Verou: bevacqua/dragula#689 (comment) (btw I had a PR on her repo but effectively we end up forking it for our own use cases).

This seems to be the most complete answer to accessible drag and drop, and it's based on dragula

Yes, I maintain a private fork of that repo on top of the dragula...

avatar crystalenka
crystalenka - comment - 31 Oct 2022

Either way, the last link I sent has a nice example of reordered lists with the minimal drop indicators etc that I mentioned; the up and down arrows would help a lot also in mitigating this issue.

avatar dgrammatiko
dgrammatiko - comment - 31 Oct 2022

the up and down arrows would help a lot also in mitigating this issue.

Joomla had those a decade ago and people didn't really liked the UX... Also mentioned in the original PR of subforms (quoting Brian here): #19184 (comment)

avatar chmst chmst - change - 31 Oct 2022
Labels Added: a11y ?
avatar chmst chmst - labeled - 31 Oct 2022
avatar chmst chmst - labeled - 31 Oct 2022
avatar crystalenka
crystalenka - comment - 31 Oct 2022

Given that the use and implementation of subforms has evolved far from the original, I'm not sure it's fair to quote comments from 5 years ago. We've all learned quite a bit in that time, and the context of use is now different.

avatar dgrammatiko
dgrammatiko - comment - 31 Oct 2022

Fair enough, I don't have strong opinions about the up/down buttons in this context (I think for the list views would be counterintuitive but for subforms (edit view) might be ok)

About the issue here I have couple comments:

  • The subforms don't have a title/description so it would be interesting to find a way to collapse the inputs in such a way that a user would not loose track of the selected (dragging) element. Making the shadow (the dragged element) a generic placeholder might be counter intuitive (especially for existing users).
  • The current implementation should be accessible at least that was our perception at the time when @Fedik did the PR
  • There are known security vulnerabilities (yes I know people are more attracted to the UI/UX than any underlying, harder to tackle issues), just saying it's not only the look and feel
avatar bembelimen
bembelimen - comment - 31 Oct 2022

Just from a usage approach, I had to implement up/down arrows (which were then used most of the time) especially for large forms (when scrolling is needed) and for mobile usage.

avatar wojtekxtx
wojtekxtx - comment - 6 Nov 2022

You make field accept-drops by adding acceptDroppables() port.

Same way you can miscil which types of drops is acceptable; example: accept JPG, DOCX, etc.

By default, however, due to security restrictions, most our servers disallows drops.

Im reminding you that instralling J! in AJP is considered mitworthy.

avatar brianteeman
brianteeman - comment - 6 Nov 2022

@wojtekxtx once again you post nonsensical text that is absolutely nothing to do with the issue here

avatar wojtekxtx
wojtekxtx - comment - 7 Nov 2022

@brianteeman I honestly dont see how my post is nonsensical. Dare to explain?

avatar brianteeman
brianteeman - comment - 7 Nov 2022

You talk about fields and filetypes.

avatar Quy
Quy - comment - 7 Nov 2022

Related #37974

avatar brianteeman
brianteeman - comment - 7 Nov 2022

@Quy how is that related. Its a completely different issue

avatar brianteeman
brianteeman - comment - 15 Nov 2022

A possible solution is collapsing rows into "ghost" representative rows while dragging so you can see more at once, and using a more minimal drop indicator instead of a full-height item.

That would be ideal but when using native draggable the "ghost" is actually an image representation of the item being dragged. Other than the background nothing else appears to be "stylable".

Everything is controlled by the browser. At 300px it changes behaviour - see https://codepen.io/thetallweeks/pen/WNYeod

avatar brianteeman
brianteeman - comment - 15 Nov 2022

(ps: What am I missing in that all my fields are displayed horizontally when yours are vertically)

avatar crystalenka
crystalenka - comment - 16 Nov 2022

(ps: What am I missing in that all my fields are displayed horizontally when yours are vertically)

It switches layouts when you have 5 or more fields in a subform.

That would be ideal but when using native draggable the "ghost" is actually an image representation of the item being dragged. Other than the background nothing else appears to be "stylable".

That is a true bummer. I'm sure there's a solution though... hm.

Everything is controlled by the browser. At 300px it changes behaviour - see https://codepen.io/thetallweeks/pen/WNYeod

It varies by browser too—in Safari, the behavior is exactly the same on both elements.

avatar brianteeman
brianteeman - comment - 16 Nov 2022

That is a true bummer. I'm sure there's a solution though... hm.

the only thing I found was this old post from an old old friend https://www.kryogenix.org/code/browser/custom-drag-image.html

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: ?
avatar Hackwar Hackwar - labeled - 22 Feb 2023
avatar micker
micker - comment - 12 Apr 2023

as i understand
if we have many field in subform we have a problem
we can use table display => not reponsive and display is exploed on right. Bad solution
maybe we can use 'span' option deuce height of subform zone, but doesn't works...
yes maybe just reduce height of zone on dragstart event like @crystalenka ?

avatar AndySDH
AndySDH - comment - 13 Sep 2023

Adding a +1 to this one. Dragging Subforms really took a step back in usability in J4 compared to J3 :(

avatar Fedik Fedik - change - 11 Nov 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-11-11 19:16:30
Closed_By Fedik
Labels Added: Feature ?
Removed: ? ?
avatar Fedik Fedik - close - 11 Nov 2023
avatar Fedik
Fedik - comment - 11 Nov 2023

Please test #42334

avatar AndySDH
AndySDH - comment - 13 Nov 2023

Please test #42334

This approach is a bit reductive and I don't feel like it fully addresses the issue. Dragging and dropping is still very bad, and I don't think adding an up and down arrow is enough to call the problem solved...

avatar Fedik
Fedik - comment - 15 Nov 2023

Dragging and dropping is still very bad

Dragging a large piece of Content is not very practical.
Realistically I do not think it can be fixed in another way, without over-complication.

But if people do not agree, we can reopen this issue.

Add a Comment

Login with GitHub to post a comment