Comments (7)
I need to double check, it might be related #636, but I think it's more related to an unhandled edge case with setting up the declarative reflex attributes.
from stimulus_reflex.
In our case the hotfix is creating a method in JS data-action="my-controller#myMethod"
and call this.stimulate('Reflex#action', event.target)
within it manually.
from stimulus_reflex.
@julianrubisch Is this still an open topic or was this issue somehow addressed/fixed in the latest changes in the past month?
I'd like to know if it's worth upgrading the lib or if we still have to use workaround via custom actions data-action
+ this.stimulate
from stimulus_reflex.
hasn't been addressed yet, sadly.
@marcoroth do we have to untie #636 ?
from stimulus_reflex.
Is there some new version/release I could try this on?
from stimulus_reflex.
Looks like I can't reproduce this on rc2.
But looking at your example you need to make sure to also include the event
itself in your data-reflex
attribute:
- data-reflex="Example#masticate"
+ data-reflex="click->Example#masticate"
So the following snippet:
<div data-controller="example">
<a href="#" data-reflex="click->Example#masticate">Eat</a>
</div>
will transform into this as expected (this is on 3.5.0.rc2
):
<div data-controller="example">
<a href="#" data-reflex="click->Example#masticate" data-action="click->example#__perform">Eat</a>
</div>
Also make sure that StimulusReflex was registered in the example
controller, otherwise it will default to the regular stimulus-reflex
controller to make it work.
from stimulus_reflex.
This should be resolved with the release of v3.5.0.rc4
. I'm going to close this issue, but please feel free to re-open if you are still seeing something unexpected!
from stimulus_reflex.
Related Issues (20)
- Document fragment now do not handle 2 siblings inputs HOT 8
- New release? HOT 1
- ArgumentError after upgrade stimulus_reflex and cable_ready HOT 7
- Broken Next Page Link on Welcome Page of Docs HOT 2
- HEAD and most of the latest releases are broken, references an undefined exception
- StimulusReflex is not compatible with the standalone ActionCable server HOT 9
- Wrong dataset getting from Docs example HOT 2
- NameError: undefined local variable or method `package_json' HOT 3
- Reflex not triggered when a Stimulus controller is also attached to a field HOT 4
- Form parse errors are not captured and reported back to front-end
- Drop Rails 5 and 6.0 support
- `solid_cache` seems to work as well as Rails cache store HOT 1
- Add full-stack tests
- Stimulus_reflex and esbuild error HOT 1
- OpenStruct no longer supported by json HOT 1
- Refactor away instances of OpenStruct
- NameError: uninitialized constant StimulusReflex::Installer::Thor when running rake tasks HOT 1
- Support `relative_url_root`
- Could not find generator 'stimulus_reflex:initializer'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stimulus_reflex.