Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f7953b6

Browse files
Adding @window (#676)
Info is taken from #675 (comment)
1 parent 9cc36fd commit f7953b6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

docs/reference/controllers.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,13 @@ class EffectsController extends Controller {
232232
```
233233

234234
If the two controllers don't belong to the same HTML element, the `data-action` attribute
235-
needs to be added to the *receiving* controller's element.
235+
needs to be added to the *receiving* controller's element. And if the receiving controller's
236+
element is not a parent (or same) of the emitting controller's element, you need to add
237+
`@window` to the event:
238+
239+
```html
240+
<div data-action="clipboard:copy@window->effects#flash">
241+
```
236242

237243
`dispatch` accepts additional options as the second parameter as follows:
238244

0 commit comments

Comments
 (0)