Skip to content

Commit 8a28885

Browse files
authored
fix: password console error when using not using edge (#467)
1 parent c9d859f commit 8a28885

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

components/password-input/src/password-input.styles.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ import { makeStyles } from "@fluentui/react-components";
33
// Hack to remove the Edge browsers built in
44
// password reveal functionality.
55
// https://github.com/microsoft/fluentui/issues/23482
6+
const isEdgeLegacy =
7+
typeof window !== "undefined" && /Edge\/\d./i.test(navigator.userAgent);
8+
69
export const usePasswordInputStyles = makeStyles({
7-
edgeHack: {
8-
"&::-ms-reveal": {
9-
display: "none",
10-
},
11-
},
10+
edgeHack: isEdgeLegacy
11+
? {
12+
"&::-ms-reveal": {
13+
display: "none",
14+
},
15+
}
16+
: {},
1217
});

examples/src/components/story/story-page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export function StoryPage({
121121
navigation,
122122
children,
123123
customHeader,
124-
status = [],
124+
status = [EStoryStatus.STABLE],
125125
...rest
126126
}: PropsWithChildren<TStoryPage>) {
127127
const { styles, rootStyle } = useStoryPageStyles();

examples/src/stories/main-menu/main-menu-page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { pageData } from "examples/src/components/story/story.utils";
22
import React from "react";
33
import { StoryPage } from "../../components/story/story-page";
4-
import { EStoryStatus } from "../../components/story/story-status";
54
import { useExampleWithNavigation } from "../../components/story/story.utils";
65
import { getGhInfoByKey } from "../../routing/route-map";
76
import { routes } from "../../routing/routes";
@@ -34,7 +33,6 @@ export const MainMenuPage = () => {
3433

3534
return (
3635
<StoryPage
37-
status={[EStoryStatus.NEW]}
3836
title="Main menu"
3937
description={
4038
"Variant of a main menu using fluent TabList and axis styling"

0 commit comments

Comments
 (0)