Problem/Motivation

Follow-up to #3246385: [drupalMedia] Support captions on <drupal-media>.

If an element inside <drupalMedia> model element is focused on editor, the contextual toolbar for the parent media element should be visible. This is required from consistency perspective because this is how the image widget works. At the moment also when caption is toggled on, it receives focus, meaning that the toolbar disappears immediately after toggling caption on.

This is how this looks currently:

Proposed resolution

Keep media contextual toolbar visible when the selection is in a child element of <drupalMedia>.

Remaining tasks

User interface changes

Before
After

API changes

Data model changes

Release notes snippet

Issue fork drupal-3264775

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lauriii created an issue. See original summary.

lauriii’s picture

wim leers’s picture

Status: Active » Needs work
Issue tags: -Needs tests

Tests were added, but aren't passing yet.

lauriii’s picture

Status: Needs work » Needs review

Pushed changes that should fix the failing test

wim leers’s picture

Issue summary: View changes
StatusFileSize
new251.57 KB
new255.35 KB
Before
After
wim leers’s picture

Status: Needs review » Needs work

Hm, looks like the failure that https://git.drupalcode.org/project/drupal/-/merge_requests/1881/diffs?co... fixed has returned? 🧐

Just left one variable naming suggestion that would make it crystal clear to me, and once that's done (and this is green again), this is RTBC for me :)

wim leers’s picture

Status: Needs work » Reviewed & tested by the community

Assuming this comes back green.

Will need patch for testing against 9.3 & 10.

bnjmnm made their first commit to this issue’s fork.

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work

A few things in the MR, one hopefully helps with some of the concerns in this thread.

lauriii’s picture

Status: Needs work » Needs review
bnjmnm’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new86.65 KB
new86.49 KB

Ready to commit when the version-specific patches are green.

  • bnjmnm committed ca174ff on 10.0.x
    Issue #3264775 by lauriii, Wim Leers: [drupalMedia] Toolbar should be...

  • bnjmnm committed c196fa9 on 9.4.x
    Issue #3264775 by lauriii, Wim Leers: [drupalMedia] Toolbar should be...
bnjmnm’s picture

Version: 9.4.x-dev » 9.3.x-dev

Committed to 9.4.x and 10.0.x, and intend to commit to 9.3.x after the first-tuesday-of-the-month freeze window.

bnjmnm’s picture

StatusFileSize
new86.66 KB

  • bnjmnm committed 73ad4fe on 9.3.x
    Issue #3264775 by lauriii, Wim Leers: [drupalMedia] Toolbar should be...
bnjmnm’s picture

Status: Reviewed & tested by the community » Fixed

Backported to 9.3.x now that the commit freeze is over.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.