Problem/Motivation

There's a bug with components containing uploadable images where if you change another prop it can reset the image to its example image.

Steps to reproduce

Place the hero or card component and upload an image to its image prop. Then while still selected on that component, change another prop's text. This should reset the image and have it disappear.

Here's a video I made documenting this bug:
https://youtu.be/p-5Aw8PHbRU

Proposed resolution

Debug.

Remaining tasks

Reproduce and debug.

User interface changes

API changes

Data model changes

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

jacobadeutsch created an issue. See original summary.

kristen pol’s picture

Title: Image resets to default when props are edited » Image resets to examples value when other props are edited
Project: Starshot Demo Design System » Experience Builder
Version: 1.0.x-dev » 0.x-dev
Component: Testing » Page builder

Thanks. I saw this before Barcelona and didn’t make an issue.

It seems like this is also affecting other props besides images too, but this is a good example to start with.

Moving to the XB queue.

kristen pol’s picture

Status: Needs review » Active

Fixing status.

shyam_bhatt’s picture

Assigned: Unassigned » shyam_bhatt
shyam_bhatt’s picture

Assigned: shyam_bhatt » Unassigned

The field image does not yet support updating the preview on change. We need to create/update the "data-media-file" attribute with a default value, Also we have to store the new image value in the form state variable. Need to check the "inputBehaviors.tsx" file.

soaratul’s picture

Assigned: Unassigned » soaratul
soaratul’s picture

Assigned: soaratul » Unassigned

I also debugged and found that in case of prop value is an object, we are not updating the preview and seems it will require some backend work.

wim leers’s picture

I suspect this is related to #3467954: META: Evolve XB UI's data model to allow non-SDC components' inputs, DynamicPropSource support, etc.. would be good to confirm.

It seems that @soaratul already did that … but an end-to-end test reproducing this bug would then go a long way in A) fixing it, B) preventing it from regressing :)

kristen pol’s picture

Not sure if this is related to this or to #3467954 but this was found when debugging this issue:

#3480935: Image Schema only works with image var in twig

soaratul’s picture

@wim-leers, I don't think this is related to #3467954

lauriii’s picture

Status: Active » Closed (outdated)

Cannot reproduce anymore.