Problem/Motivation
When using the dropdown lists in content overview or content types overview, I've noticed the dropbutton is only as wide as the first item (eg. 'edit') and when the list contains longer terms (eg. 'translate), the whole component becomes wider, which makes the cell wider and pushes content.


Proposed resolution
Implement this according to the design system which shows that the list width doesn't have to match with the width of the button:

Status with the latest patch
This is how it looks like with the latest patch reapplied after moving the theme to core. It doesn't jump anymore so seems to be solving the issue.

Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comments
Comment #2
rembrandx commentedComment #3
rembrandx commentedComment #4
villette commentedI rerolled the alpha3 patch for the alpha4 version.
AFAIC, this patch works fine, I'm updating this issue to needs review, but I don't think I can do it myself though
Comment #5
villette commentedComment #6
rembrandx commentedOn the admin-ui channel on Drupal Slack, it was mentioned that this is related to: https://www.drupal.org/project/claro/issues/3067697
and the team is postponing these because of refactoring:
In any case, I'm taking some time to reroll the patch for alpha 5, for anyone wanting a fix until that then.
Comment #7
lauriiiRemoved point 2. since it's duplicate to #3067697: Dropbutton breaks when text is split to multiple lines.
Comment #8
rembrandx commentedRerolled the patch, for alpha 5, tested with D8.7wrong version, see #11 for correct oneComment #9
rembrandx commentedRerolled patch for 8.x-1.x
Comment #10
rembrandx commentedRerolled patch for 8.x-2.x
Comment #11
rembrandx commentedAh, uploaded the wrong one for alpha 5.
This is the correct one!
Comment #12
rembrandx commentedSince development moved to the 8.x-2.x branch, I'm changing the version for this issue as well.
Comment #13
huzookaComment #14
villette commentedI rerolled the patch for 1.0-beta1. Although I have next to no idea what this patch actually does, so if someone could review it that would be top, thanks!
Comment #15
villette commentedComment #16
huzookaComment #17
melinda_ksz commented@Svitlana and me are starting to look into this issue on DrupalCon Amsterdam.
Comment #18
svitlana commentedwe are starting to reapply the last patch after it got moved to the core.
Comment #19
svitlana commentedWe had to reapply the patch from #14, because claro has been moved to core.
Here is the new patch.
Comment #20
svitlana commentedComment #21
melinda_ksz commentedI have tested the patch from #19, and it looks like it works. The dropdown is not jumping anymore.
I have added a screenshot to the issue summary too, so that it can be seen how it looks like with the latest patch.
Comment #22
melinda_ksz commentedComment #23
huzookaWell, this makes secondary dropbutton actions inaccessible (unvisible and unfocusable) without JS. Why did this have to be changed?
Comment #24
rembrandx commentedThat bit is explained by the comment above it: it prevents the open list of flashing before the styling kicks in. I admit it is a bit of a hack and it can benefit from some finetuning. I did not take into account non-js browsing because the Drupal back-end relies heavily on JS for a good user experience.
Comment #25
huzookaRe #24:
Core uses javascript for improving UX, and not for providing the functionality.
Comment #26
kostyashupenkoRe #23 and #25:
Original issue was about jumping dropbutton when list is opened, so now it should be fixed. Also reverted some code back to unblock issues from 23 and 25 comments.
Comment #27
kostyashupenkoComment #28
KondratievaS commentedTested in Chrome, FF, Safari and IE for desktop and mobile resolutions and result is OK
Comment #29
KondratievaS commentedComment #31
kostyashupenkoComment #32
kostyashupenkoComment #33
xjmThis would be a minor-only change. Since 8.9.x and 9.0.x are now in beta, I'm moving this to 9.1.x. Thanks!
I'd want @lauriii's review here to commit this.
Comment #34
lauriiiBefore:

After:

Comment #35
ckrinaGood change!
Comment #36
lauriiiThank you for all the work on this issue! I discussed this issue with @ckrina and we agreed that we probably shouldn't make this change since this doesn't work well in some use cases. For example, the media types page looks like this:
The dropbutton element has always worked like this and this same problem exists in Seven. We agreed that the right solution for this is solving #1899236: Add new Splitbutton render element to eventually replace Dropbutton.
Comment #37
ahebrank commentedReroll for 9.4.