Skip to content

Commit

Permalink
Merge pull request #69 from deriv-com/aizad/password-input-fix-2
Browse files Browse the repository at this point in the history
Aizad/Password Input Fix
  • Loading branch information
shayan-deriv authored Feb 9, 2024
2 parents 5462574 + 969e3e5 commit db9dbf3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 5 additions & 1 deletion lib/components/PasswordInput/PasswordInput.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ $ERROR: #ec3f3f;
position: relative;
display: inline-block;

&__wrapper {
z-index: 2;
}

&--full {
width: 100%;
}

&__meter {
position: absolute;
z-index: -1;
z-index: 1;
border-radius: 0px 0px 4px 4px;
width: 100%;
height: 4px;
Expand Down
7 changes: 4 additions & 3 deletions lib/components/PasswordInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ const PasswordVariant: Record<TScore, InputProps["variant"]> = {
};

export const PasswordInput = ({
value,
hidePasswordMeter,
hint,
onBlur,
onChange,
hint,
hidePasswordMeter,
value,
...rest
}: PasswordInputProps) => {
const [isTouched, setIsTouched] = useState(false);
Expand Down Expand Up @@ -98,6 +98,7 @@ export const PasswordInput = ({
})}
>
<Input
wrapperClassName="deriv-password__wrapper"
value={value}
type={showPassword ? "text" : "password"}
message={isTouched ? errorMessage : "" || hint}
Expand Down
2 changes: 1 addition & 1 deletion src/stories/PasswordInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const HidePasswordMeter: Story = {
hint: "This is a hint message",
},
render: (args) => {
const [value, setValue] = useState("");
const [value, setValue] = useState(args.value);

return (
<PasswordInput
Expand Down

0 comments on commit db9dbf3

Please sign in to comment.