In #3240131: Drupal.behavior gets attached multiple times instead of once, a check was added to prevent attaching multiple times. Unforunately, this also kills AJAX funktionallity, since AJAX will not pass in "document", but the respective element. Since we are loading the library on demand, this never gets executed since "document" never matches context.
Using context to pass in the detected elements to ClipboardJS seems the more suitable approach. Additionally, a "detach" function could be added to unregsiter possible clipboard events
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3255469-1.patch | 924 bytes | drcolossos |
Comments
Comment #2
drcolossos commentedComment #3
drcolossos commentedComment #4
drcolossos commentedComment #5
lind101 commentedI am haing the same issue when trying to use the ClipboardJS field formatters for fields loaded inside a Modal. Unfortuantly, the patch in #2 doesn't seem to fix the problem for me.
Comment #6
sanduhrsThis obviously makes sense, thanks!
Comment #7
sanduhrs