Closed (works as designed)
Project:
Drupal core
Version:
8.9.x-dev
Component:
javascript
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Jan 2011 at 17:45 UTC
Updated:
6 Jul 2021 at 12:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sunSounds like a good idea to me.
Comment #2
nod_Comment #3
Bojhan commentedWorks here, I think this is a good idea too. Do you actually remove it, or just hide it through JS, because our screenreader users shouldn't have it either?
Comment #4
Bojhan commentedComment #5
nod_I filter the selector, If there is only one row with the draggable class, the behavior is not run on it. So yeah, It'll remove all the stuff for screenreaders too.
Comment #6
Bojhan commentedI imagine you can keep it from being rendered at all? If you can fix that part its RTBC from my perspective, sure someone can give it a code review then.
Comment #7
nod_I don't understand which behavior you're describing, have you tried the patch ?
Comment #8
sunI think this patch, and thus avoiding tabledrag via JS, is the right approach. AJAX operations might be adding or changing the page content, so when re-attaching behaviors on the same page, we want to actually see the tabledrag.
That said, don't we need to hide the weight column in the table?
Comment #9
Bojhan commentedAhh, I think I was just confused by the "weight" table row still being there. Is there a reason that is still there?
Comment #10
nod_You're right, I wanted to avoid all processing but it just end up being confusing. Here is a better one.
Comment #11
nod_reroll
Comment #12
Bojhan commented:)
Comment #13
dries commentedCommitted to 8.x. Thanks!
Comment #14
David_Rothstein commentedThis seems to have broken lots of stuff - for example, on a default Drupal install go to admin/structure/types/manage/page/display and you can't drag the single field to "Hidden" anymore, or click "Edit shortcuts", delete one of the two shortcuts, and try to drag the remaining one to disabled, etc.
Basically, if there's more than one region to drag to, the drag handles should never be removed. If that's not easy to fix, this patch should be rolled back.
Also, for what it's worth, the "Show row weights" links are still showing for me in these cases.
***
I was actually wondering if it made sense to backport the original patch here to Drupal 7 (since it's a borderline bugfix, I think)... but obviously no chance until the above issues are resolved :)
Comment #15
nod_So I was going to write a patch and started my reply but the main issue here is that the way we disable/enable rows is clunky. There is no point in fixing this patch, it's the whole UI that needs fixing as it's pretty much useless on mobile too.
I'm meeting up with Bojhan at drupaljam this friday to see what can be done about tabledrag UX. We'll add that to the list of things to talk about.
Sorry about the UI breakage, please rollback this patch. We'll take it in a followup of #1524414: Rewrite tabledrag.js to use jQuery UI.
Comment #16
David_Rothstein commentedOK, thanks. I guess #11 is RTBC for the rollback; don't think we need a new patch since the patch can just be reverse-applied.
Comment #17
catchRolled this back.
Comment #18
catchComment #19
nod_Comment #20
andypostSuppose new behavior should enable table drag in case table gets updated via ajax
Comment #21
andypostClosely related #1855402: Add generic weighting (tabledrag) support for config entities (DraggableListController)
Comment #22
droplet commentedHide tabledrag handle: AGREED
For example. we have 2 diff tables, and fetch the data from these 2 tables and sort by "weight". Remove the row weight column, I have no way to set the value.
Comment #23
tstoeckler@droplet: I don't think that use-case is common enough that it should introduce a column that is useless in 95% of the cases. In case it's hard to alter the weight column back in in your specific case, then it should be a follow-up issue to make that easy. But we should still remove it IMO.
@nod_/all: What is the status of this issue? I just stumbled on this coming from #1855402: Add generic weighting (tabledrag) support for config entities (DraggableListController) and still think it is very useful.
Comment #24
nod_Not touching tabledrag anymore.
Comment #25
nod_Comment #26
David_Rothstein commentedThat issue is for 8.1.x (or possibly later) and doesn't have a patch. Plus I think we do still want to backport this to Drupal 7, if it's possible to fix it without breaking other things?
Comment #27
nod_I'm not confident it's possible without some serious code change. I gave it an honest go at #15 and it got out of hands the fact I still remember it should give a clue :þ
Comment #28
droplet commentedIf I'm honest, I'd say close it as "won't fix". Keeping UI consistency is another point for usability. (Even good for theme styles)
Comment #42
pameeela commentedI was going to agree with #28 and say won't fix, but to my great surprise, this already is fixed in Seven and Claro. At least, it doesn't show the tabledrag handle. It still shows the row weight but I think that's fine.