-
+
{
this.onInputClick(this.inputStore.ref, event);
}}
+ onFocus={this.onFocus}
+ onBlur={this.onBlur}
>
{alertStore.filters.values.map(filter => (
-
diff --git a/ui/src/Components/NavBar/FilterInput/index.css b/ui/src/Components/NavBar/FilterInput/index.scss
similarity index 72%
rename from ui/src/Components/NavBar/FilterInput/index.css
rename to ui/src/Components/NavBar/FilterInput/index.scss
index 13cd709ea..20e315844 100644
--- a/ui/src/Components/NavBar/FilterInput/index.css
+++ b/ui/src/Components/NavBar/FilterInput/index.scss
@@ -1,9 +1,12 @@
+@import "src/Theme.scss";
+
.form-control.components-filterinput {
cursor: text;
height: auto;
min-height: 2.6rem;
box-shadow: none;
+ background-clip: unset;
padding-top: 1px;
padding-bottom: 1px;
@@ -25,3 +28,9 @@ input.components-filterinput-wrapper {
margin-top: 2px;
margin-bottom: 2px;
}
+
+.form-control.bg-focused,
+.input-group-text.bg-focused,
+.input-group-append.bg-focused {
+ background-color: lighten($blue, 5%);
+}
diff --git a/ui/src/Components/NavBar/FilterInput/index.test.js b/ui/src/Components/NavBar/FilterInput/index.test.js
index 432c2c6df..c141ec6dc 100644
--- a/ui/src/Components/NavBar/FilterInput/index.test.js
+++ b/ui/src/Components/NavBar/FilterInput/index.test.js
@@ -121,6 +121,20 @@ describe("
", () => {
expect(inputSpy).not.toHaveBeenCalled();
});
+ it("focusing input changes background color", () => {
+ const tree = MountedInput();
+ const formControl = tree.find(".form-control");
+ formControl.find("input").simulate("focus");
+ expect(toDiffableHtml(tree.html())).toMatch(/bg-focused/);
+ });
+
+ it("bluring input changes background color", () => {
+ const tree = MountedInput();
+ const formControl = tree.find(".form-control");
+ formControl.find("input").simulate("blur");
+ expect(toDiffableHtml(tree.html())).not.toMatch(/bg-focused/);
+ });
+
it("componentDidMount executes even when inputStore.ref=null", () => {
const tree = MountedInput();
const instance = tree.instance();