question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Action params not passed when event is load@window, working otherwhise?

See original GitHub issue

Am I’m missing something from the documentation?

<a data-controller="test"
  data-action="load@window->test#foo mouseover->test#foo"
  data-test-bar-param="baz">
  Hello World!
</a>

When load@window event params is an empty object. When mouseover it’s ok { bar: "baz" }.

// test_controller.js
import { Controller } from '@hotwired/stimulus';

export default class extends Controller {
  foo({ params }) {
    console.log(params);
  }
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
adrienpolycommented, Jul 5, 2022

There is on known issue https://github.com/hotwired/stimulus/pull/495 merge but not yet published.

Will check for what is required to get this released

1reaction
gremocommented, Jul 5, 2022

@rupasix

The load event is fired when the whole page has loaded, including all dependent resources such as stylesheets and images.

Exactly what I need/want.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why aren't my parameters getting passed through to a ...
Use CustomEvent instead of Event for creating custom events. Specify your data in a 'details' object (see code). I changed the event name ......
Read more >
Params not being passed when navigating between Stacks ...
I use the following code to create an initial screen that does not have a NavBar but pushes on a stack that contains...
Read more >
Apex param not passing the value - in action support event on ...
am i doing something wrong here, please help me to get the value of fid to controller, i can't use action function as...
Read more >
How to pass parameter in event - ServiceNow Community
If the business rule is being triggered as part of a scheduled job, use a GlideRecord argument in its place. Parm1, Passes a...
Read more >
Recommended events | Google Analytics 4 Properties
Because these events require additional context to be meaningful, they are not sent automatically. Use this article to see the required and optional...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found