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
Data attribute like data-placeholder & other not working after an upgrade to 4.0.6-rc.1 from 4.0.5 #5320
Comments
Can confirm this bug. I made some debugs and it seems that keys in Utils.__cache are being stored AFTER they are needed, so it always returns undefined when Utils.GetData is looking for keys. I checked that these keys are needed in select2/options but they are created (Utils.StoreData) in select2/core, which runs afterwards. If you need a workaround so that you get data-* attributes to Select2 options, you can do this:
Just do this with other data-* attributes if you need it, until the issue is solved. |
Thanks @deimoks & @pedrofurtado |
It works, but the templates and matcher messes around 😢 |
Workaround from @joaopedroraldi didn't work for me but I solved it this way:
|
Confirmed - 4.0.6-rc.0 also suffers from this bug. I used Looks like I'm using the 4.0.6 version to get the fix for #4356 which is an ugly problem, but now I suffer from not being able to use the The last release was almost a year ago. I can't see this issue being fixed or in outstanding pull requests either. Does anybody know if there is an attempt to fix it? The workarounds described above are pretty ugly! |
Just wanted to
The clear button displays as expected, but on click the ID returns |
If allowClear: true and NOT placeholder: ""/placeholder: "Some Placeholder" is defined you get and error when clicking on the clear button. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
As I see it, the issue still exists. Bump. |
Bump. |
4.0.6-rc1 is just broken and shouldn't be used. Someone was briefly "maintaining" the project and made that release, but actually they just messed tons of stuff up. |
All this would have been fixed with the new changes in #4346 more than a year ago, but no action was taken. |
Is there a version where this works? I'm using 4.0.6-rc.1 and is still broken. |
I've been trying to reproduce this ever since the bug was first submitted (admittedly with some large gaps, as many of you have noticed), and I finally figured out why this wasn't caught by the test suite. The test suite runs against jQuery 1.x, which happens to be the only version of jQuery that does not have this issue. Modifying the test suite to run against jQuery 2.x verifies that this issue does exist. |
@kevin-brown, PS: I created another PR #5475 with the same changes as #4346 since the latter was closed due to inactivity. |
Hello,
After the upgrade from 4.0.5 to 4.0.6-rc.1 data attributes like data-placeholder, minimum-input-length etc not working.
As per 4.0.5 JSBin
As per 4.0.6-rc.1 JSBin
As far as I have checked it seem it is due to change in cache of data property using Utils.GetData
P.S. Creating issue for the first time in this repository, Please Pardon me if I have missed anything special to mention here.
The text was updated successfully, but these errors were encountered: