[ALOY-1497] Alloy model - filtered change event fires with any attribute
GitHub Issue | n/a |
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-03-09T21:35:55.000+0000 |
Affected Version/s | Release 5.2.2 |
Fix Version/s | n/a |
Components | Models |
Labels | alloy, models |
Reporter | Brian García |
Assignee | Unknown |
Created | 2016-05-05T17:20:41.000+0000 |
Updated | 2018-03-07T22:28:26.000+0000 |
Description
Test case from alloy sample sql_no_migrations. Replace index.js with the attached file
steps to reproduce:
- touch label at top bar to add an item as many times as you want
- touch the added item
- run the app again
-touch any item
-touch label at top bar
- see the logs
Expected:
The expected log is to see only the secondTestField change. 'changed secondTestField expected secondTestField'
Result:
After running again the app and touching the top label the log is the following: 'changed firstTestFieldexpected secondTestField'
Attachments
File | Date | Size |
index.js | 2016-05-05T17:20:43.000+0000 | 1129 |
testCase.zip | 2016-05-05T19:33:12.000+0000 | 10478089 |
Hello, The code you provided for regenerating the issue is not sufficient enough. Replacing the index.js with the attached index.js shows the below error
Please provide a full reproducible test code. Regards, Sharif.
That's because I started from a sample project. I've attached the whole project. Thanks
Hello, I tried to test your issue. I was able to reproduce the issue. I found the following log on second run in ios. I follow instruction as run the app again -touch any item(I touched twice) -touch label at top bar see the logs
Regards, Sharif.
Thanks, as you can see the last log should be 'changed secondTestFieldexpected secondTestField' as the above ones but instead it is 'changed firstTestFieldexpected secondTestField' when the change event is binded only to secondTestField. Regards,
Please add to config.json
"backbone": "1.1.2"
and use [model.changedAttributes](http://backbonejs.org/#Model-changedAttributes) in the change event callback to retrieve a hash of only the model's attributes that have changed.Closing as invalid. If this is incorrect, please reopen.