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.

closed list
open list

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

lordrembo created an issue. See original summary.

rembrandx’s picture

Issue summary: View changes
StatusFileSize
new2.77 KB
new1.32 KB
rembrandx’s picture

Issue summary: View changes
villette’s picture

Status: Active » Needs review

I 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

villette’s picture

StatusFileSize
new2.77 KB
rembrandx’s picture

On 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:

We discussed about https://www.drupal.org/project/claro/issues/3067697 few months ago decided that we probably will have to refactor the markup and the code for better accessibility and for easier styling. Since it felt like a huge rabbit hole, we decided not to focus on that right now

In any case, I'm taking some time to reroll the patch for alpha 5, for anyone wanting a fix until that then.

lauriii’s picture

Issue summary: View changes
Status: Needs review » Active
StatusFileSize
new157.14 KB
rembrandx’s picture

StatusFileSize
new2.77 KB

Rerolled the patch, for alpha 5, tested with D8.7 wrong version, see #11 for correct one

rembrandx’s picture

StatusFileSize
new1.57 KB

Rerolled patch for 8.x-1.x

rembrandx’s picture

StatusFileSize
new1.57 KB

Rerolled patch for 8.x-2.x

rembrandx’s picture

StatusFileSize
new3.07 KB

Ah, uploaded the wrong one for alpha 5.
This is the correct one!

rembrandx’s picture

Version: 8.x-1.0-alpha3 » 8.x-2.x-dev

Since development moved to the 8.x-2.x branch, I'm changing the version for this issue as well.

huzooka’s picture

Project: Claro » Drupal core
Version: 8.x-2.x-dev » 8.9.x-dev
Component: User interface » Claro theme
villette’s picture

StatusFileSize
new2.93 KB

I 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!

villette’s picture

Status: Active » Needs review
huzooka’s picture

Status: Needs review » Needs work
melinda_ksz’s picture

@Svitlana and me are starting to look into this issue on DrupalCon Amsterdam.

svitlana’s picture

we are starting to reapply the last patch after it got moved to the core.

svitlana’s picture

StatusFileSize
new3.57 KB

We had to reapply the patch from #14, because claro has been moved to core.
Here is the new patch.

svitlana’s picture

Status: Needs work » Needs review
melinda_ksz’s picture

Issue summary: View changes
StatusFileSize
new35.09 KB

I 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.

melinda_ksz’s picture

Issue summary: View changes
huzooka’s picture

Status: Needs review » Needs work
+++ b/core/themes/claro/css/src/components/dropbutton.css
@@ -433,10 +439,24 @@
-.js .dropbutton-wrapper:not(.open) .dropbutton__item:first-of-type ~ .dropbutton__item {
+/**
+ * Hide the list items of dropdown before JS is loaded to prevent seeing an
+ * open list of items when page is loading.
+ */
+
+.dropbutton-wrapper:not(.open) .dropbutton__item:first-of-type ~ .dropbutton__item {
   display: none;
 }

Well, this makes secondary dropbutton actions inaccessible (unvisible and unfocusable) without JS. Why did this have to be changed?

rembrandx’s picture

That 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.

huzooka’s picture

Re #24:

Core uses javascript for improving UX, and not for providing the functionality.

kostyashupenko’s picture

Status: Needs work » Needs review
StatusFileSize
new2.01 KB

Re #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.

kostyashupenko’s picture

Version: 8.9.x-dev » 9.0.x-dev
KondratievaS’s picture

StatusFileSize
new214.82 KB

Tested in Chrome, FF, Safari and IE for desktop and mobile resolutions and result is OK

OK

KondratievaS’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 26: dropbutton-sizing-3067262-26.patch, failed testing. View results

kostyashupenko’s picture

Status: Needs work » Needs review
kostyashupenko’s picture

Status: Needs review » Reviewed & tested by the community
xjm’s picture

Version: 9.0.x-dev » 9.1.x-dev
Issue tags: +Needs frontend framework manager review

This 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.

lauriii’s picture

Before:

After:

ckrina’s picture

Good change!

lauriii’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (works as designed)
Issue tags: -Needs frontend framework manager review
StatusFileSize
new29.11 KB

Thank 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.

ahebrank’s picture

StatusFileSize
new1.7 KB

Reroll for 9.4.