DEV: Do not reuse core's element ID for the input (#14)

This changes `search-term` widget's ID for the input so that we do not
include two elements with the same ID in the DOM.
This commit is contained in:
Penar Musaraj 2022-07-27 12:27:40 -04:00 committed by GitHub
parent 3caedad451
commit 107be68180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -41,6 +41,9 @@ $max-width: 600px;
position: relative;
display: flex;
input[type="text"] {
border-width: 0;
margin-bottom: 0;
flex-grow: 1;
margin: 0;
width: 100%;
padding-right: 4em;

View File

@ -18,6 +18,10 @@ export default apiInitializer("0.8", (api) => {
const searchMenuWidget = api.container.factoryFor("widget:search-menu");
const corePanelContents = searchMenuWidget.class.prototype["panelContents"];
api.reopenWidget("search-term", {
buildId: () => "search-banner-term",
});
api.reopenWidget("search-menu", {
buildKey(attrs) {
let type = attrs.formFactor || "menu";