Skip to content

Commit

Permalink
Fix: Use mwModelAttr if provided to set selected item of selectbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarlex committed Jun 3, 2020
1 parent bef0b8b commit 68437f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v1.24.4
## Bug Fixes
- `mwSelectBox`: Use mwModelAttr if provided to set selected item of selectbox

# v1.24.3
## Bug Fixes
- Remove angular sanitize from file include in mwUI.Relution to provide angular 1.5 support
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mw-uikit",
"description": "A toolbox to build portals with AngularJS 1.5.x that have a lot of forms and list views for example admin portals to manage data.",
"author": "Alexander Zarges <[email protected]> (http://relution.io)",
"version": "1.24.3",
"version": "1.24.4",
"license": "Apache-2.0",
"dependencies": {
"showdown": "1.2.3",
Expand Down
5 changes: 3 additions & 2 deletions src/mw-inputs/directives/mw_select_box.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ angular.module('mwUI.Inputs')
};

var setSelectedVal = function () {

if (scope.mwModel.id) {
if(scope.mwModelAttr){
scope.viewModel.selected = scope.mwModel.get(scope.mwModelAttr);
} else if (scope.mwModel.id) {
scope.viewModel.selected = scope.mwModel.id.toString();
}
};
Expand Down

0 comments on commit 68437f8

Please sign in to comment.