You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The stimulus component affirms that the controller should read as follows
import { Application } from '@hotwired/stimulus'
import PasswordVisibility from 'stimulus-password-visibility'
const application = Application.start()
application.register('password-visibility', PasswordVisibility)
when most controllers are initialized as import { Controller } from "@hotwired/stimulus"
The naming of the controller is apparently agnostic to its contents, as the documentation suggests index.js. The following case uses passwordview_controller.js
Whatever the attempts, in the following three variants, the following errors are encountered in the browser console:
import { Application } / Application.start()
import { Controller } / Application.start()
import { Controller } / Controller.start()
config/importmap.rb includes pin "stimulus-password-visibility", to: "https://ga.jspm.io/npm:stimulus-password-visibility@2.0.0/dist/stimulus-password-visibility.es.js"
do note that there is a css issue, where buttons appear below the input field, which was subject to a failed attempted to be fixed here, in an initial case, before defining a specific class for this use-case, via style definitions (tailwind is uber-view-polluting IMHO) - may require a different issue
GIven the rails out-of-the-box contents of javascript/application.js
The stimulus component affirms that the controller should read as follows
when most controllers are initialized as
import { Controller } from "@hotwired/stimulus"
The naming of the controller is apparently agnostic to its contents, as the documentation suggests
index.js
. The following case usespasswordview_controller.js
Whatever the attempts, in the following three variants, the following errors are encountered in the browser console:
![application_application](https://user-images.githubusercontent.com/716130/202371468-215a7e4f-6853-4c18-bf06-3c3d0c757bb1.png)
import { Application } / Application.start()
import { Controller } / Application.start()
![controller-application](https://user-images.githubusercontent.com/716130/202371740-89e8be5d-b440-4d6e-b5cc-56c85fd0cc23.png)
import { Controller } / Controller.start()
![controller controller](https://user-images.githubusercontent.com/716130/202371799-f2c4c7f5-f7fc-48b7-bac8-436f292796e8.png)
config/importmap.rb
includespin "stimulus-password-visibility", to: "https://ga.jspm.io/npm:stimulus-password-visibility@2.0.0/dist/stimulus-password-visibility.es.js"
view set to
do note that there is a css issue, where buttons appear below the input field, which was subject to a failed attempted to be fixed here, in an initial case, before defining a specific class for this use-case, via style definitions (tailwind is uber-view-polluting IMHO) - may require a different issue
GIven the rails out-of-the-box contents of
javascript/application.js
how should this component be effectively written?
This is pertinent to all these components as they follow an identical pattern...
The text was updated successfully, but these errors were encountered: