-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove dependency on jquery #163
Comments
It would be nice to drop the jQuery dependency, but last time I checked I couldn't find an off-the-shelf vanilla js control which did everything we need. It has been a while though, so may be worth another look. It may make sense to keep Select2 for Django admin - last time I checked it used select2 for fk autocomplete. Tagulous is designed to support swappable controls though - in theory we just need to find a lib which supports tags and hooks for tag parsing, then we can write an adaptor for it and tell tagulous which one to use in the settings. A home-grown autocomplete would be another option - I wrote one in an early version - but to be honest that sounds like a commitment I probably don't have time to build and support at the moment. |
I started a branch this evening (feature/choices-js) but have now remembered the issue: I can't see a way to pre-populate a text field with choices (for some reason the "choices" option only works with It looks like other people have requested this in the past - notably Choices-js/Choices#525 and Choices-js/Choices#856 which both seem to add options to a select. From a backend perspective it would make more sense to me to show choices on a text, so that approach may be worth investigating too - but given the age of those PRs I'm not hopeful they or anything we did would be merged soon, so we'd be looking at having to fork it, which doesn't seem ideal. This feels like such an obvious use case that I'm hoping I've just missed an option somewhere. I've started using choices.js in other projects where I'm not currently using Tagulous, so this is definitely something I'd like to achieve, but at the moment I just can't see a practical way forward - looking at the complexity of the source for choices, it almost feels easier to write my own. Note to anyone looking at this in the future: assuming we can get round this autocomplete issue, the next problem will be tag parsing. They don't support quoted tags, so there will be a potential inconsistency between the client and server parsers which will need to be tested carefully. If it is a problem and we want to use the |
After updating our website to bootstrap 5,
django-tagulous
becomes the only component that depends on jquery. It would be nice ifdjango-tagulous
could be updated to use vanilla JS.I understand
django-tagulous
largely depends onselect2
(which is based onjquery
), but maybe another select library could be used (e.g. Choices although I have never used it.)The text was updated successfully, but these errors were encountered: