-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 regression/bug since 0.15 #1976
Comments
This is an important regression (the documented |
Update: I just noticed that my readDataNew doesn't mimic the latest code as another commit fixed the isJSON method: This commit is about documentation so I didn't notice it, but it actually fixes the isJSON method: Using the fixed isJSON the result for my test code seems to be ok:
|
@bago yes, the problem in the |
Hi. I just upgraded from the old 0.12 to 0.15.2. |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days |
This bot automations are really bad for the community. |
(or gave a link to a demo on the Selectize docs)
like below
In 0.14 this code
<option data-data='{"url":"https://www.google.com"}'>value</option>
generated an "item.url" property.
In 0.15 this generates an "item.data.url" property instead (and also a buggy item.'{"url":"https://www.google.com"}' property )
You can see the bug in this jsbin (change the html code to include 0.14.0 and it will work fine):
https://jsbin.com/legilux/edit?html,js,console,output
Steps to reproduce:
Expected result:
item.url = "https://www.google.com"
Actual result:
item.data.url = "https://www.google.com"
The issue has been introduced in 111e6f3 breaking the data-data JSON handling at all. Then it has been refactored in c9ed4e8 but supporting data-* moved the data-data object from the root to the data subproperty.
I don't know if this is expected (i doubt the
item.'{"url":"https://www.google.com"}'
to be expected, anyway), but I guess if this is expected it should be documented in the changelog (or maybe I didn't find it).Here is the code for readData before, in the middle and after the changes and the results of the call to that function:
The text was updated successfully, but these errors were encountered: