8326694: Defer setting of autocapitalize attribute
Reviewed-by: jjg
This commit is contained in:
parent
38ad514589
commit
be2b92bd8b
@ -480,8 +480,7 @@ public class Navigation {
|
||||
var inputText = HtmlTree.INPUT(HtmlAttr.InputType.TEXT, HtmlIds.SEARCH_INPUT)
|
||||
.put(HtmlAttr.PLACEHOLDER, resources.getText("doclet.search_placeholder"))
|
||||
.put(HtmlAttr.ARIA_LABEL, resources.getText("doclet.search_in_documentation"))
|
||||
.put(HtmlAttr.AUTOCOMPLETE, "off")
|
||||
.put(HtmlAttr.AUTOCAPITALIZE, "off");
|
||||
.put(HtmlAttr.AUTOCOMPLETE, "off");
|
||||
var inputReset = HtmlTree.INPUT(HtmlAttr.InputType.RESET, HtmlIds.RESET_SEARCH)
|
||||
.put(HtmlAttr.VALUE, resources.getText("doclet.search_reset"));
|
||||
var searchDiv = HtmlTree.DIV(HtmlStyle.navListSearch)
|
||||
|
@ -84,8 +84,7 @@ public class SearchWriter extends HtmlDocletWriter {
|
||||
.add(HtmlTree.DIV(HtmlTree.INPUT(HtmlAttr.InputType.TEXT, HtmlId.of("page-search-input"))
|
||||
.put(HtmlAttr.PLACEHOLDER, resources.getText("doclet.search_placeholder"))
|
||||
.put(HtmlAttr.ARIA_LABEL, resources.getText("doclet.search_in_documentation"))
|
||||
.put(HtmlAttr.AUTOCOMPLETE, "off")
|
||||
.put(HtmlAttr.AUTOCAPITALIZE, "off"))
|
||||
.put(HtmlAttr.AUTOCOMPLETE, "off"))
|
||||
.add(HtmlTree.INPUT(HtmlAttr.InputType.RESET, HtmlId.of("page-search-reset"))
|
||||
.put(HtmlAttr.VALUE, resources.getText("doclet.search_reset"))
|
||||
.put(HtmlAttr.STYLE, "margin: 6px;"))
|
||||
|
@ -95,8 +95,7 @@ public class TableOfContents {
|
||||
.add(HtmlTree.INPUT(HtmlAttr.InputType.TEXT, HtmlStyle.filterInput)
|
||||
.put(HtmlAttr.PLACEHOLDER, writer.resources.getText("doclet.filter_label"))
|
||||
.put(HtmlAttr.ARIA_LABEL, writer.resources.getText("doclet.filter_table_of_contents"))
|
||||
.put(HtmlAttr.AUTOCOMPLETE, "off")
|
||||
.put(HtmlAttr.AUTOCAPITALIZE, "off"))
|
||||
.put(HtmlAttr.AUTOCOMPLETE, "off"))
|
||||
.add(HtmlTree.INPUT(HtmlAttr.InputType.RESET, HtmlStyle.resetFilter)
|
||||
.put(HtmlAttr.VALUE, writer.resources.getText("doclet.filter_reset")));
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ public enum HtmlAttr {
|
||||
ARIA_ORIENTATION("aria-orientation"),
|
||||
ARIA_SELECTED("aria-selected"),
|
||||
AUTOCOMPLETE,
|
||||
AUTOCAPITALIZE,
|
||||
CHECKED,
|
||||
CLASS,
|
||||
CLEAR,
|
||||
|
@ -246,6 +246,7 @@ document.addEventListener("DOMContentLoaded", function(e) {
|
||||
}
|
||||
document.querySelectorAll("input.filter-input").forEach(function(input) {
|
||||
input.removeAttribute("disabled");
|
||||
input.setAttribute("autocapitalize", "off");
|
||||
input.value = "";
|
||||
input.addEventListener("input", function(e) {
|
||||
const pattern = input.value ? input.value.trim()
|
||||
|
@ -244,6 +244,7 @@ $(window).on("load", function() {
|
||||
setSearchUrl();
|
||||
});
|
||||
input.prop("disabled", false);
|
||||
input.attr("autocapitalize", "off");
|
||||
reset.prop("disabled", false);
|
||||
|
||||
var urlParams = new URLSearchParams(window.location.search);
|
||||
@ -263,4 +264,4 @@ $(window).on("load", function() {
|
||||
notify.html(messages.enterTerm);
|
||||
}
|
||||
input.select().focus();
|
||||
});
|
||||
});
|
||||
|
@ -426,6 +426,7 @@ $(function() {
|
||||
});
|
||||
search.val('');
|
||||
search.prop("disabled", false);
|
||||
search.attr("autocapitalize", "off");
|
||||
reset.prop("disabled", false);
|
||||
reset.click(function() {
|
||||
search.val('').focus();
|
||||
|
@ -434,7 +434,7 @@ public class TestSearch extends JavadocTester {
|
||||
"""
|
||||
<div class="nav-list-search">
|
||||
<input type="text" id="search-input" disabled placeholder="Search" aria-label="S\
|
||||
earch in documentation" autocomplete="off" autocapitalize="off">
|
||||
earch in documentation" autocomplete="off">
|
||||
<input type="reset" id="reset-search" disabled value="Reset">
|
||||
</div>""");
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ public class TestSpecTag extends JavadocTester {
|
||||
<ol class="sub-nav-list"></ol>
|
||||
<div class="nav-list-search">
|
||||
<input type="text" id="search-input" disabled placeholder="Search" aria-label="S\
|
||||
earch in documentation" autocomplete="off" autocapitalize="off">
|
||||
earch in documentation" autocomplete="off">
|
||||
<input type="reset" id="reset-search" disabled value="Reset">
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user