URL not sumbitted (missing context in JS behavior detach

Created on 29 May 2024, 10 months ago
Updated 30 May 2024, 10 months ago

Problem/Motivation

The module attaches a JS behavior to autosubmit when a URL is filled in.
once("auto-remote-url-add", "input[data-drupal-file-url-remote]", context).forEach

In some scenarios, such as on a clean core 10.3.x and file_url 2.x setup with toolbar and big_pipe modules enabled, the autosubmit doesn't work/happen.
It looks like the JS behavior is being detached, and the change event gets wrongly removed, because the context is missing as a 3rd argument:
once.remove("auto-remote-url-add", "input[data-drupal-file-url-remote]").forEach...

Steps to reproduce

- Install clean drupal core 10.3.x (standard profile with toolbar and big_pipe) + file_url 2.x
- Create a file_url field in page nodes
- Go on a page node edit/create form
- Click "Remote file URL", fill in a valid URL, and click/tab outside the input
>> Actual behavior: nothing happens
>> Expected behavior: the URL gets submitted and added as field item

Proposed resolution

Add the missing context to 3rd argument of once.remove

🐛 Bug report
Status

Active

Version

2.0

Component

User interface

Created by

🇧🇪Belgium herved

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @herved
  • 🇧🇪Belgium herved

    I created 2 branches:
    - one that simply adds the missing context in JS
    - one that replaces the URL autosubmit and JS with a "Add URL" button.

Production build 0.71.5 2024