Closed meneerprins closed 6 years ago
@meneerprins,
As a workaround that you can use from the StimulusJS side, see this issue: https://github.com/stimulusjs/stimulus/issues/124
I modified my StimulusJS application schema to use data-saction
instead of data-action
, so that when CropperJS gets around to adding the same customization feature it will be easier to search and replace.
That is indeed an option but I would still prefer to change the Cropperjs data tag since it's generated & the Stimulus data-action is used in tons of places in a large application. Is there really no other possibility?
I, too, would love to see out-of-the-box compatibility, here. Specifically, applying the cropper
namespace to the data keys in the same way it's currently applied to the class keys would be a simple path to such compatibility.
@fengyuanchen would you consider a PR to this effect? I'd be happy to put one together.
I'm submitting a...
Current behavior
CropperJS adds [data-action] attributes when initialised and StimulusJS uses [data-action] to add behaviours which results in issues when using both libraries.
Suggested behaviour
Add an option to change the name of the data attributes, add a namespace or change the default name (like [data-cropperjs-action]).
Minimal reproduction of the problem with instructions
Use StimulusJS and CropperJS at the same time.
What is the motivation / use case for changing the behavior?
CropperJS is the only crop library that has everything I need and StimulusJS is new but already has many people that want to use it and I found this problem when redoing a whole app with StimulusJS.
Environment