Closed simonpay closed 7 years ago
Hi,
Any help on this would be appreciated.
Thanks
Do you use Webpack?
If you are using the webpack, please see this #8
Thanks for the reply.
I'm not using Webpack. Are there other options for me?
Thanks for the pointer in https://github.com/rkit/react-select2-wrapper/issues/8.
Based on this I used pathmodify to rewrite the path for select2 to the full version (I'm using browserify):
The relevant portion of my gulp task looks like this:
...
return browserify('./src/app.js')
/**
* Use pathmodify to replace the reference to select2 with
* the full version of the lib to support adding a class to
* the generated dropdown markup.
*/
.plugin(pathmodify, {
mods: [
pathmodify.mod.id('select2', 'select2/dist/js/select2.full'),
],
})
...
I'm trying to set a class in the generated select2 dropdown container via the
dropdownCssClass
option.E.g.
I read that this option requires the full version of select2 to work.
I'm able to get it working by changing the code on line 29 of /react-select2-wrapper/lib/components/Select2.js from:
require('select2');
to:
require('select2/dist/js/select2.full');
Is there any way I can tell react-select2-wrapper to use the full version without hacking the package?
Thanks