-
+
+
+ {immutableText}
+
+
+
+
);
};
diff --git a/src/app/base/components/PrefixedInput/_index.scss b/src/app/base/components/PrefixedInput/_index.scss
index aa57e83f3a..ab7969f9a4 100644
--- a/src/app/base/components/PrefixedInput/_index.scss
+++ b/src/app/base/components/PrefixedInput/_index.scss
@@ -2,15 +2,18 @@
.prefixed-input {
position: relative;
- &__wrapper::before {
+ .prefixed-input__text {
position: absolute;
pointer-events: none;
padding-left: $spv--small;
padding-bottom: calc(0.4rem - 1px);
padding-top: calc(0.4rem - 1px);
- // TODO: Investigate replacement for using these variables https://warthogs.atlassian.net/browse/MAASENG-3116
- content: var(--immutable, "");
- top: var(--top, "inherit");
+ }
+
+ &--with-label {
+ .prefixed-input__text {
+ top: 2.5rem;
+ }
}
}
-}
+}
\ No newline at end of file
diff --git a/src/app/base/components/PrefixedIpInput/PrefixedIpInput.test.tsx b/src/app/base/components/PrefixedIpInput/PrefixedIpInput.test.tsx
index cc6c9e8024..41042b8f40 100644
--- a/src/app/base/components/PrefixedIpInput/PrefixedIpInput.test.tsx
+++ b/src/app/base/components/PrefixedIpInput/PrefixedIpInput.test.tsx
@@ -10,18 +10,6 @@ import PrefixedIpInput from "./PrefixedIpInput";
import { renderWithBrowserRouter } from "@/testing/utils";
-const { getComputedStyle } = window;
-
-beforeAll(() => {
- // getComputedStyle is not implemeneted in jsdom, so we need to do this.
- window.getComputedStyle = (elt) => getComputedStyle(elt);
-});
-
-afterAll(() => {
- // Reset to original implementation
- window.getComputedStyle = getComputedStyle;
-});
-
it("displays the correct range help text for a subnet", () => {
render(
@@ -31,20 +19,6 @@ it("displays the correct range help text for a subnet", () => {
expect(screen.getByText("10.0.0.[1-254]")).toBeInTheDocument();
});
-it("sets the --immutable css variable to the immutable octets of the subnet", () => {
- render(
-
-
-
- );
-
- // Direct node access is needed here to check the CSS variable
- expect(
- screen.getByRole("textbox", { name: "IP address" }).parentElement
- ?.parentElement
- ).toHaveStyle(`--immutable: "10.0.0."`);
-});
-
it("displays the correct placeholder for a subnet", () => {
render(