Skip to content

Commit

Permalink
SVY-15444 bootstrapcomponents textbox visibility weird behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
lvostinar committed Sep 18, 2020
1 parent 7b8a300 commit 4cbdcfd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions textbox/textbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ angular.module('bootstrapcomponentsTextbox',['servoy']).directive('bootstrapcomp
link: function($scope, $element, $attrs) {

var formatState = null;
var child = $element.children();
var ngModel = child.controller("ngModel");

$scope.model.autocomplete = $scope.model.autocomplete ? $scope.model.autocomplete : 'off';

Expand All @@ -21,7 +19,12 @@ angular.module('bootstrapcomponentsTextbox',['servoy']).directive('bootstrapcomp
{
if (formatState)
formatState($scope.model.format);
else formatState = $formatterUtils.createFormatState(child, $scope, ngModel,true,$scope.model.format);
else
{
var child = $element.children();
var ngModel = child.controller("ngModel");
formatState = $formatterUtils.createFormatState(child, $scope, ngModel,true,$scope.model.format);
}
}
})
}
Expand Down Expand Up @@ -82,6 +85,7 @@ angular.module('bootstrapcomponentsTextbox',['servoy']).directive('bootstrapcomp
// fill in the api defined in the spec file

$scope.api.onDataChangeCallback = function(event, returnval) {
var ngModel = $element.children().controller("ngModel");
var stringValue = typeof returnval == 'string'
if(returnval === false || stringValue) {
ngModel.$setValidity("", false);
Expand Down

0 comments on commit 4cbdcfd

Please sign in to comment.