Skip to content
Snippets Groups Projects
Commit af44e955 authored by Emmanuel ROHEE's avatar Emmanuel ROHEE
Browse files

BF: made input autofocus work when opening the room topic input

parent 7e7eb0ef
No related branches found
No related tags found
No related merge requests found
...@@ -58,6 +58,11 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) ...@@ -58,6 +58,11 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
$scope.topic.newTopicText = ""; $scope.topic.newTopicText = "";
} }
// Force focus to the input
$timeout(function() {
angular.element('.roomTopicInput').focus();
}, 0);
$scope.topic.isEditing = true; $scope.topic.isEditing = true;
}, },
updateTopic: function() { updateTopic: function() {
......
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
{{ events.rooms[room_id]['m.room.topic'].content.topic | limitTo: 200}} {{ events.rooms[room_id]['m.room.topic'].content.topic | limitTo: 200}}
</div> </div>
<form ng-submit="topic.updateTopic()" ng-show="topic.isEditing" class="roomTopicForm"> <form ng-submit="topic.updateTopic()" ng-show="topic.isEditing" class="roomTopicForm">
<input ng-model="topic.newTopicText" ng-blur="topic.cancelEdit()" class="roomTopicInput" <input ng-model="topic.newTopicText" ng-blur="topic.cancelEdit()" class="roomTopicInput" />
autofocus />
</form> </form>
</div> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment