Skip to content

Commit 4335952

Browse files
committed
Clarifed comment about why we do not propagate keydown events.
1 parent 0261995 commit 4335952

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

code_comments/htdocs/code-comments.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ var underscore = _.noConflict();
168168
render: function() {
169169
this.$el.html(this.template({formatting_help_url: CodeComments.formatting_help_url}))
170170
.dialog({ autoOpen: false, title: 'Add Comment', close: this.close, modal: true });
171-
// Prevent keypresses in the dialog from being intercepted by other scripts
171+
// As the textarea in our dialog is created after Trac's
172+
// keyboard_nav.js has bound, we have to stop keydown events
173+
// propoagating in order to avoid unexpected navigation while the
174+
// user is typing their comment.
172175
this.$el.keydown(function(e) {
173176
event.stopPropagation();
174177
});

0 commit comments

Comments
 (0)