Comments (6)
Hi Luis! I'm really sorry that you're having such a weird and frustrating problem. I'm in the process of trying to recreate it. In particular, it's the first time I've heard of a problem being specific to the nodetype of the element the controller is placed upon.
Are you on our Discord server? It might be easier to get help in the future.
Also, I just want to say that this is a near-perfect issue submission. I appreciate that it's difficult to set up a reproduction example when there's a server component. All of this detail can really help us help you faster.
from stimulus_reflex.
@hopsoft, you are right. The element that fires the reflex needs to have a unique id.
In my case the simple_form_for was the culprit, and adding an id to the form fixed the issue:
<%= simple_form_for :service_schedule, data: { controller: "serviceschedule", reflex_root: "#search-results" }, html: { method: :post, id: :search_service_schedules_form } do |f| %>
<% end %>
Thanks!
from stimulus_reflex.
Hi @leastbad, thanks for your quick response.
Don't worry, it's been a pleasure to use this gem, other than this small hiccup the library is working like a charm.
I just joined the Discord server: Luis de Haro, I'll keep this in mind in case of any future issue.
And thank you for all your help if you need any further detail, just let me know.
from stimulus_reflex.
@LuisDeHaro could I get you to update your gem to 2.2.2 and make sure you also yarn update your JS package, too. I always forget.
from stimulus_reflex.
@leastbad, sure. I just did and now the issue has changed.
It throws an error immediately after I enter to the page that has the table you see in the above gifs. Error:
application.js:250 Error connecting controller
TypeError: this.getConfig is not a function
at createConsumer (action_cable.js:25)
at getConsumer (consumer.js:26)
at createSubscription (stimulus_reflex.js:67)
at Object.register (stimulus_reflex.js:161)
at Controller.connect (application_controller.js:6)
at Controller.connect (serviceschedule_controller.js:20)
at Context.connect (context.js:23)
at Module.connectContextForScope (module.js:39)
at Router.scopeConnected (router.js:100)
at ScopeObserver.elementMatchedValue (scope_observer.js:55)
{identifier: "serviceschedule", controller: Controller, element: form.simple_form.service_schedule}
identifier: "serviceschedule"
controller: Controller {context: Context, StimulusReflex: {…}, stimulate: ƒ, __perform: ƒ}
element: form.simple_form.service_schedule
proto: Object
Also, I don't get the channel subscription confirmation like before. I don't get this:
StimulusReflex::Channel is transmitting the subscription confirmation
StimulusReflex::Channel is streaming from StimulusReflex::Channel:1
After the yarn upgrade, the stimulus_reflex package looks like this in the yarn.lock:
[email protected]:
version "2.2.2"
resolved "https://registry.yarnpkg.com/stimulus_reflex/-/stimulus_reflex-2.2.2.tgz#0bc46bfbb442f2cf980e3436f16282c92924f6fd"
integrity sha512-X0QCohbGcBngoUmG5mDXFsVzcBgvKUWAMYSPfrv2eN72IkZqn+vGQFeC3sJncU2t9WIqbRu52/PgBFn7KHbhYQ==
dependencies:
actioncable ">= 5.2"
cable_ready ">= 4.0"
inflected ">= 2.0"
stimulus ">= 1.1"
Please let me know if you need some more info, I'll be glad to help. Thanks in advance!
from stimulus_reflex.
@LuisDeHaro Try adding a unique id
to your anchor elements that define data-reflex=...
from stimulus_reflex.
Related Issues (20)
- Controller over reflex attribute is ignore and reflex is always called with default StimulusReflexController 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'
- Unrecognized command "esbuild" (Rails::Command::UnrecognizedCommandError)
- Installer should work in CI (noninteractive) environment
- docs recommend hiredis gem along with incompatible redis version
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.