Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I have a field attached to a node, referencing a simple ajax form. The input become smaller each time the user is trying to upload an image. Attached is a video describing the problem, the exported webform and a screenshot with the markup that got duplicated each time the image was uploaded.
Thank you~
Comment | File | Size | Author |
---|---|---|---|
#6 | 3260300-6.patch | 934 bytes | jrockowitz |
#4 | 3260300-4.patch | 847 bytes | jrockowitz |
webform-upload-image.mkv | 3.15 MB | gge | |
webform.webform.test_upload_image.yml | 5.1 KB | gge | |
Screenshot-202201251103-1370x805.png | 169.14 KB | gge |
Comments
Comment #2
gge CreditAttribution: gge commentedForgot to mention that the theme is a bootstrap subtheme and Webform Bootstrap module is enabled.
Comment #3
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThis issue is identical to #3178033: Textarea multiple inside flexbox broken where the Ajax callback is re-rendering the flexbox wrapper.
The challenge is we don't have control over the ManagedFile element's ajax callback.
Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedHere is a POC solution. This issue is related to the file upload being inside a flexbox element and not the Bootstrap theme.
Comment #5
gge CreditAttribution: gge commentedThank you very much! The patch is working great!
Comment #6
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI am worried that this patch is going to cause regressions when another element's ajax callback is triggered.
I am moving this logic to WebformManagedFileBase class so we can better track and limit the scope of the problem and solution.
Comment #7
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #10
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #12
drumm(updating to fix issue indexing error, please disregard)