GUACAMOLE-817: Merge reset keyboard state on navigation and form submission.

This commit is contained in:
Virtually Nick
2019-09-29 20:32:50 -04:00
committed by GitHub

View File

@@ -138,6 +138,12 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
keyboard.reset(); keyboard.reset();
}; };
// Release all keys upon form submission (there may not be corresponding
// keyup events for key presses involved in submitting a form)
$document.on('submit', function formSubmitted() {
keyboard.reset();
});
/** /**
* Checks whether the clipboard data has changed, firing a new * Checks whether the clipboard data has changed, firing a new
* "guacClipboard" event if it has. * "guacClipboard" event if it has.
@@ -188,6 +194,11 @@ angular.module('index').controller('indexController', ['$scope', '$injector',
$scope.fatalError = error; $scope.fatalError = error;
}); });
// Ensure new pages always start with clear keyboard state
$scope.$on('$routeChangeStart', function routeChanging() {
keyboard.reset();
});
// Update title and CSS class upon navigation // Update title and CSS class upon navigation
$scope.$on('$routeChangeSuccess', function(event, current, previous) { $scope.$on('$routeChangeSuccess', function(event, current, previous) {