The 'Alternative Text' field in the quickedit bubble for single image fields has a wrong placeholder, it currently reads 'alt'.
In #2421427-57: Improve the UX of Quick Editing single-valued image fields was agreed to use 'Alternative Text' as a label instead.

However, this is not really helpful to use as a placeholder as well.
The placeholder should give an example or explain the 'techy' label better.

Furthermore, let's do something about the design of the field. It is not consistent and looks not finished.
We can align it to the left and/or make it 100% width of the bubble.

Before:

After:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dmsmidt created an issue. See original summary.

Wim Leers’s picture

Title: Improve quickedit single image alt text field » Improve the "Image" InPlaceEditor plugin's "alt" attribute UI
Category: Bug report » Task
Issue tags: +Usability

+1

This should take inspiration from \Drupal\editor\Form\EditorImageDialog — both in terms of its precise title and placeholder, as well as its validation error behavior.

yoroy’s picture

Issue tags: +sprint
yoroy’s picture

left align and full width looks much better! lets have a patch :-)

tkoleary’s picture

Assigned: Unassigned » tkoleary
dmsmidt’s picture

@tkoleary, note that we have a starting contributor working on a patch during the ux print (rkoller).

rkoller’s picture

Assigned: tkoleary » rkoller
rkoller’s picture

Ok in the following the positioning issue of the label and input field got fixed by removing the .quickedit-image-field-info selector completely. That moved the input to the left. Afterwards the field got set to 100% in width in .quickedit-toolgroup, along a failsave for the case if the type is set to submit set. In the js file the unnecessary wrapping div got removed and Drupal.t('Alternative text') entered for the alt placeholder.

Thanks for @dmsmidt and @tkoleary for advice and guidance along the way. Hope everything is placed correctly. If no please notify me, is my first commit and i try to learn and improve. ;) Cheers r.

dmsmidt’s picture

@rkoller, nice working together with you, and thanks a lot for your patch.

It almost works! However we forgot to also modify the "Stable" theme. So I duplicated you changes to the theme.
(Tip: in patch naming we normally add the comment number after the issue id)

So, manually tested and looks nice, patch is clean and simple.

dmsmidt’s picture

Assigned: rkoller » Unassigned
tkoleary’s picture

@dsmidt

Stable theme cannot be modified so we need to add the css to seven themes quickedit css.

Quickedit module has a libraries override to inject seven's quickedit css in to front-end themes.

dmsmidt’s picture

@tkoleary, when this feature was added Stable was also modified. So why can't we here? It fixes the problems that are only in 8.3.x (dev) and haven't been released in a stable Drupal release, so no body should be using it, and nobody needs backwards compatibilty there. Could you point to a page which clearly states, what can and can't be done to Stable (and when)? Thanks.

tkoleary’s picture

@dsmidt

Sorry, you are right. If it's styling new markup it can be added to stable.

samuel.mortenson’s picture

diff --git a/core/modules/quickedit/css/quickedit.theme.css b/core/modules/quickedit/css/quickedit.theme.css
index 399db7a..9896427 100644
--- a/core/modules/quickedit/css/quickedit.theme.css
+++ b/core/modules/quickedit/css/quickedit.theme.css
@@ -180,6 +180,12 @@
 .quickedit-toolbar-fullwidth {
   width: 100%;
 }
+.quickedit-toolgroup input {
+  width: 100%;
+}

Has this been tested when there's both a Title and Attribute enabled for an Image field? The reason flexbox was used before was so that the two inputs sit side by side at half width.

mgifford’s picture

Status: Needs review » Needs work

Ok, sounds like we need to ensure "two inputs sit side by side at half width." as per @samuel.mortenson

@dmsmidt feel free to revert if I'm wrong about this.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

sylus’s picture

Re-rolling against latest 8.x-5.x-dev.

mgifford’s picture

Status: Needs work » Needs review

Thanks @sylus - btw was talking with your team last night. Sounds like things are in a much better place (which is amazing).

samuel.mortenson’s picture

Status: Needs review » Needs work

The review from #14 has not been addressed in the latest patch, unless it's more than a re-roll.

yoroy’s picture

FileSize
877.47 KB

I tested this patch on simplytest. I enabled the title attribute for the image in the Article content type and then used quick edit the image. I don't get to see a title field at all:

The form for updating the title attribute is not added to the Quick edit window. Making the title attribute required did not change that.

(side note: I had to manually remove the float:left on the image in Bartik before I could even reach the image via quickedit. The body text div was over it when floated)

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

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

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Spokje’s picture

Project: Drupal core » Quick Edit
Version: 9.4.x-dev » 1.0.x-dev
Component: quickedit.module » Code

Due to Quickedit being moved out of Drupal Core and into a Contrib Module, moving this issue to the Contrib Module queue.