spartacus icon indicating copy to clipboard operation
spartacus copied to clipboard

fix: password visibility toggle component support for SVG icons

Open sebospc opened this issue 2 years ago • 1 comments

Problem This pull request addresses an issue with the PasswordVisibilityToggleComponent in Spartacus. Currently, the component works well with Font Awesome. However, when a project opts to use SVG icons exclusively, the component fails to switch icons appropriately.

User Impact The existing behavior affects projects aiming for icon optimization using SVG, resulting in inconsistent icon display within the PasswordVisibilityToggleComponent.

Solution To resolve this issue, I've refactored the PasswordVisibilityToggleComponent to utilize a ngSwitch for handling different icon states. This change enables the component to seamlessly switch between SVG icons based on password visibility.

Technical Details Introduced a ngSwitch structure in the HTML template to toggle between SVG icons based on the showState and hideState. Modified the component logic to correctly update the icon state and reflect changes in password visibility. This change allows for a more flexible icon handling approach, accommodating projects utilizing SVG icons without compromising functionality.

sebospc avatar Nov 20 '23 02:11 sebospc

CLA assistant check
All committers have signed the CLA.

cla-assistant[bot] avatar Nov 20 '23 02:11 cla-assistant[bot]