Skip to content
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

Allow select2_js to be list #189

Merged
merged 2 commits into from
Feb 8, 2023
Merged

Allow select2_js to be list #189

merged 2 commits into from
Feb 8, 2023

Conversation

pickfire
Copy link

In certain cases such as breakage to select2 like the one below, one can have a patch by loading another js.

select2/select2#5993

In certain cases such as breakage to select2 like the one below, one can have a patch by loading another js.

select2/select2#5993
@codingjoe
Copy link
Owner

Hi @pickfire,

Thanks for reaching out. Interesting idea. Your implementation would change the API, but be backwards compatible. However, we might want to add deprecation here. I don't want to keep legacy code or type casting in the code forever. Deprecation, in the next major version, should be fine.

I am curious though, what is your use case? What other JS do you need to inject his way? If it's unrelated, I'd recommend writing your own custom subclass to inject other form media.

Cheers!
Joe

@codingjoe codingjoe added the enhancement New feature or request label Dec 27, 2022
@codecov
Copy link

codecov bot commented Dec 27, 2022

Codecov Report

Base: 99.25% // Head: 99.26% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (99a0d87) compared to base (8c2982e).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 99a0d87 differs from pull request most recent head 027c6f2. Consider uploading reports for the commit 027c6f2 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #189   +/-   ##
=======================================
  Coverage   99.25%   99.26%           
=======================================
  Files           7        7           
  Lines         270      272    +2     
=======================================
+ Hits          268      270    +2     
  Misses          2        2           
Impacted Files Coverage Δ
django_select2/conf.py 100.00% <100.00%> (ø)
django_select2/forms.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pickfire
Copy link
Author

pickfire commented Jan 3, 2023

I am curious though, what is your use case? What other JS do you need to inject his way? If it's unrelated, I'd recommend writing your own custom subclass to inject other form media.

One js is to load the original select2 javascript, another js is to patch select2 bug to work with never version of jquery. See the issue I linked.

Copy link
Owner

@codingjoe codingjoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I swapped the defaults to better reflect the ability to use lists in the documentation. Otherwise, I think we're good to go. Thanks @pickfire 👍

@codingjoe codingjoe merged commit 38ce1d6 into codingjoe:main Feb 8, 2023
@pickfire pickfire deleted the patch-1 branch February 9, 2023 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants