Skip to content

Conversation

@Gounaya
Copy link

@Gounaya Gounaya commented Aug 1, 2025

Closes #1086

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 1, 2025

expect(toggleButton.querySelector("i")).toHaveClass("glyphicon-eye-open");

// Act: Click to toggle to text
fireEvent.click(toggleButton);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

il serait préférable d'utiliser userEvent au lieu de fireEvent

"af-form__pass",
);

const [type, setType] = useState<"text" | "password">("password");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

il serait préférable d'utiliser une ref pour changer à la voler le type de l'input dans devoir faire un re render du composant.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on a besoin d'un rerender pour l'icone au bout du champ je pense

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pas forcement via la ref tu l'input on peux changer le type sans devoir faire de rerender react.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je pense que tu n'as pas saisi mon commentaire :
On a une icone qui dépend du type de l'input. En text on a une icone d'oeil barré, et en password une icone d'oeil ouvert.
Si tu ne rerender pas, ca ne sera pas mis a jour.

onToggleType={() =>
setType(type === "password" ? "text" : "password")
}
onToggleType={() => {}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ca ne serait pas plus simple de supprimer la props onToggleType ou de la rendre facultatif ?

@pplancq pplancq added bug Something isn't working agent-slash Component for the agent theme labels Aug 7, 2025
type={type}
ref={inputRef}
required={classModifier?.includes("required")}
aria-label={inputProps["aria-label"] || "password"} // Fallback to ensure accessibility
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoir un aria-label password ne me semble pas idéal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-slash Component for the agent theme bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SLASH] - Modification des composants Pass / PassInput

5 participants