-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
ngCellHasFocus assumes outermost editableCellTemplate element is the input element #436
Comments
+1 |
I'd like to see the Input elements disconnected from the ngCellHasFocus directive using messages. In ngCellHasFocus directive: $scope.$broadcast('startEdit');
$scope.$on('endEdit', function() {
$scope.isFocused = false;
domUtilityService.digest($scope);
}); all this code would be removed: ////Remove html comments for IE8
//var elementWithoutComments = angular.element(elm[0].children).filter(function () {
// return this.nodeType !== 8;
//});
//var inputElement = angular.element(elementWithoutComments[0].children[0]);
//if (inputElement.length > 0) {
// angular.element(inputElement).focus();
// $scope.domAccessProvider.selectInputElement(inputElement[0]);
// angular.element(inputElement).bind('blur', function () {
// $scope.isFocused = false;
// domUtilityService.digest($scope);
// return true;
// });
//} In ngInput directive: scope.$on('startEdit', function () {
elm.focus();
});
angular.element(elm).bind('blur', function () {
scope.$emit('endEdit');
}); I tested this against the latest and it works well. Now I can wrap my input elements in divs/spans, whatever and control exactly what element's blur triggers the end edit. What do you guys think? |
Sounds good to me. I'll test it out when I get home. |
the events are now ngGridEventStartCellEdit and ngGridEventEndCellEdit |
Shouldn't this be working in 2.0.7? I've got ngGridEventEndCellEdit working but ngGridEventStartCellEdit doesn't seem to be working. |
ngCellHasFocus assumes outermost editableCellTemplate element is the input element, which causes breakage when trying to wrap the input in a span (whether for style/layout purposes or to use ng-switch to vary the type of input based on the model). Here's the line that embodies the assumption:
The text was updated successfully, but these errors were encountered: