Problem/Motivation

It is easy for editors to accidentally create duplicate media entities using the Bynder compact UI. The "Add asset" button is slow to respond and does not disable itself when the user clicks, so editors can be confused into thinking they need to click it again, while things are working in the background. This results in multiple Bynder entities being created for the same asset.

GIF screencast showing issue

Steps to reproduce

Select an asset with the Compact UI, click the "Add asset" button, confirm the button shows an ajax load, but then goes back to "Add asset" and is clickable again before the browser submits.

Proposed resolution

Disable the "Add asset" button until the form is complete.

Remaining tasks

User interface changes

API changes

None expected

Data model changes

None expected

Issue fork bynder-3259398

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

Dave Reid created an issue. See original summary.

dave reid’s picture

This may be a bug report to file with the Compact UI itself, but I think the slowdown is the Drupal AJAX request, because I don't see the button revert back to "Add asset" when using the native non-Drupal version.

dave reid’s picture

Title: Compact UI submit button is slow and does not disable itself on click, making it possible to create media » Compact UI submit button is slow and does not disable itself on click, making it possible to create duplicate media
berdir’s picture

Discussed internally, it might be the form submission that is not async? we could try to put that inside a setTimeout() to see if that helps.

dave reid’s picture

We keep running into this with editors, it's incredibly easy to accidentally click that button twice while it's working the first time but not showing anything.

richardbporter’s picture

This is even more problematic when DAT is enabled. @berdir could you expand on the async/setTimeout idea or any others you might have?

primsi made their first commit to this issue’s fork.

primsi changed the visibility of the branch 4.x to hidden.

primsi’s picture

StatusFileSize
new1.92 MB

Discussed with @berdir to try with hiding the compact view entirely and replace it with `Uploading assets...`

primsi’s picture

Status: Active » Needs review

The first file attached, showing the status, didn't seem to work. Trying with a link to google drive.

https://drive.google.com/file/d/1qu32wkGvGjEZII71vRsP7K5zekIrRgaD/view?u...

primsi’s picture

Additional note: I use throttling so it's more obvious. That's why it's so slow.

adam-delaney’s picture

Status: Needs review » Reviewed & tested by the community

@primsi, I've tested you changes and this works for me. Do we know if we can get a stable release for this module with this included?

  • berdir committed 92889871 on 4.x authored by primsi
    Issue #3259398 by primsi, dave reid, adam-delaney: Compact UI submit...
berdir’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for testing and confirming. Merged, a release will follow soon.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.