File tree 2 files changed +2
-2
lines changed
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ Put the following code in ``chat/templates/chat/index.html``:
175
175
<script >
176
176
document .querySelector (' #room-name-input' ).focus ();
177
177
document .querySelector (' #room-name-input' ).onkeyup = function (e ) {
178
- if (e .keyCode === 13 ) { // enter, return
178
+ if (e .key === ' Enter ' ) { // enter, return
179
179
document .querySelector (' #room-name-submit' ).click ();
180
180
}
181
181
};
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ Create the view template for the room view in ``chat/templates/chat/room.html``:
63
63
64
64
document .querySelector (' #chat-message-input' ).focus ();
65
65
document .querySelector (' #chat-message-input' ).onkeyup = function (e ) {
66
- if (e .keyCode === 13 ) { // enter, return
66
+ if (e .key === ' Enter ' ) { // enter, return
67
67
document .querySelector (' #chat-message-submit' ).click ();
68
68
}
69
69
};
You can’t perform that action at this time.
0 commit comments