- 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. - 🇧🇪Belgium herved
I opened a MR for the 2nd option: replace the URL autosubmit and JS with a "Add URL" button.
Because this is a much better approach for UX: an autosubmit on input change is very intrusive for the user and a button is a much better approach.I did have to refactor the #access applied on elements because having it to FALSE causes havoc.
It seems in that case Drupal doesn't understand what button triggered the action in\Drupal\Core\Form\FormBuilder::handleInputElement
and considers the first button in form_state was clicked. This causes all kinds of misbehaviors. - 🇧🇪Belgium herved
This patch can be combined with 🐛 PHP warnings from FileUrlWidget Needs review which fixes another error with the widget.
Maybe it's best to centralize both in a single issue? - 🇵🇱Poland alorenc Wolsztyn, 🇵🇱
It works for me, but there is a question regarding the supported Drupal version.