Modify ↓
#12228 closed defect (fixed)
Disable autocomplete on datepicker and datetimepicker inputs
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.2 |
Component: | general | Version: | |
Severity: | normal | Keywords: | jqueryui |
Cc: | Branch: | ||
Release Notes: |
Autocomplete is disabled for text fields with a datepicker or datetimepicker. |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
It would be nice to disable autocomplete on the datepicker and datetimepicker inputs.
Proposed change:
-
trac/templates/layout.html
diff --git a/trac/templates/layout.html b/trac/templates/layout.html index 96d93a1..f14da91 100644
a b 62 62 $(".trac-autofocus").focus(); 63 63 $(".trac-target-new").attr("target", "_blank"); 64 64 if ($.ui) { /* is jquery-ui added? */ 65 $(".trac-datepicker:not([readonly])").datepicker(); 66 $(".trac-datetimepicker:not([readonly])").datetimepicker(); 65 $(".trac-datepicker:not([readonly])").datepicker() 66 .focus(function() { 67 $(this).prop("autocomplete", "off"); 68 // return false; 69 }); 70 $(".trac-datetimepicker:not([readonly])").datetimepicker() 71 .focus(function() { 72 $(this).prop("autocomplete", "off"); 73 // return false; 74 }); 67 75 } 68 76 $(".trac-disable").disableSubmit(".trac-disable-determinant"); 69 77 setTimeout(function() { $(".trac-scroll").scrollToTop() }, 1);
Should I return false
to avoid the default behavior and prevent bubbling? So far I can't see any difference in behavior when returning false
vs no return value.
Attachments (1)
Change History (5)
by , 9 years ago
Attachment: | Autocomplete.png added |
---|
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Thanks, that's much simpler. Committed to trunk in [14344].
Note:
See TracTickets
for help on using tickets.
Good idea.
I think we could simply set
autocomplete="off"
withoutfocus()
listener.