adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
746 stars 753 forks source link

Component-specific Dropzone Placeholder Text Lost when Editor loaded in Preview #2834

Open HitmanInWis opened 3 months ago

HitmanInWis commented 3 months ago

Bug Present as of Version: 2.25.5-SNAPSHOT

(very similar issue to https://github.com/adobe/aem-core-wcm-components/issues/2833, including the "Special Note" about the bug being masked on the WCM Core Brand Library.)

On the page editor, the Drop Zones for Accordion/Tabs/Carousel in Edit mode generally state "Please drag Accordion/Tab/Carousl items here". However, if the page editor is first loaded in Preview mode and then switched to Edit mode the drop zones are all labeled with the generic "Drag components here", confusing them with other dropzones (such as the main content drop zone) on the page. The author must refresh the entire page (in Edit mode) to restore the component-specific labels to drop zones.

This is b/c the HTL code in the .html files for Accordion/Carousel/Tabs only sets the data-placeholder-text value if wcmmode.edit which is only true if the page is loaded in Edit mode. Swapping from Preview mode to Edit mode does not refresh the page, and thus does not re-run the HTML.

Example from tabs.html:

data-placeholder-text="${wcmmode.edit && 'Please drag Tab components here' @ i18n}"

should be updated to

data-placeholder-text="${!wcmmode.disabled && 'Please drag Tab components here' @ i18n}"

This update should be made in all 3 components.