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
730 stars 736 forks source link

Incorrect use of wcmmode.edit and wcmmode.preview in HTL files #2031

Open gquintillan opened 2 years ago

gquintillan commented 2 years ago

Bug Report

Current Behavior

With Touch UI a change of the layer/​mode does no longer lead to a page reload, except for mode 'disabled', therefore we should only use that mode on server-side (even with negation). Every other mode/​layer needs to be treated on client-side.

This can be tested with the accordion component: https://github.com/adobe/aem-core-wcm-components/blob/1b0503ca5d79d5f30615cad939fd26c0a77f46d6/content/src/content/jcr_root/apps/core/wcm/components/accordion/v1/accordion/accordion.html#L17

Edit mode (OK): image

Preview mode (KO): image

Expected behavior/code The current wcmmode is taken into account.

Environment

Possible Solution Use !wcmmode.disabled instead, although it does not differentiate between wcmmode.edit and wcmmode.preview..

I also saw another solution, using initwcm.js, but I did a quick test and I think we will have the same problem:

ahmadjubair33 commented 2 years ago

Hi, @adobe @gquintillan Assign this issue to me I will update the HTML file.Thank you

ncordeiro commented 1 year ago

This issue also occurs with embeddables like youtube etc and any custom embeddable written. Kindly suggest