Skip to content

fix: ue image update handling#25

Merged
mhaack merged 5 commits intomainfrom
image-fix
Mar 2, 2026
Merged

fix: ue image update handling#25
mhaack merged 5 commits intomainfrom
image-fix

Conversation

@mhaack
Copy link

@mhaack mhaack commented Mar 2, 2026

@aem-code-sync
Copy link

aem-code-sync bot commented Mar 2, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@mhaack mhaack merged commit 157aae0 into main Mar 2, 2026
0 of 2 checks passed
}
}
document.body.addEventListener('aue:content-patch', ({ detail: { patch, request } }) => {
if (!/image/.test(patch.name)) return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't we say that we move this to check of the data-aue-type as it is done in the cors.js?
What if someone is silly naming any text input field image?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, wanted to keep it simpler :-)

Actually we can remove that line and it should still work. A we check for media type 3 lines below.

if (element?.getAttribute('data-aue-type') !== 'media') return;

(element.tagName === 'IMG' ? element.closest('picture') : element)
?.querySelectorAll('source')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we just search for all elements having srcset attribute set (so it would also include img tags) and remove them?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But source tags we would have to remove, while img srcset would would only need to remove the attribute. Will create a new PR for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants