-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0b78552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really need it? (May be choice reactivity as option).
0b78552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'll always want reactivity otherwise the wrong selected value can get stuck showing. But maybe AutoForm can provide a more specific reactive variable that doesn't trigger reruns unless the options have changed.
0b78552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain please. I did not understand.
0b78552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example if you have an update form and a list of documents, and you can click on a document to change the
doc
for the form reactively (like http://autoform.meteor.com/updateaf). Before this change, the value from the previous doc would remain selected. So this fixes that bug.0b78552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But native elements works without this routine. I do not understand how.
0b78552
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is related to the way the select2 library handles values. It doesn't notice when Blaze updates the options list
selected
attributes. Probably some internal caching or something. So we need to explicitly tell select2 what to select.