Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password field show/hide icon does not update according to theme #811

Open
Pallav-sculptsoft opened this issue Oct 30, 2024 · 3 comments
Open
Labels
bug-verified A bug that can be reproduced control-textfield
Milestone

Comments

@Pallav-sculptsoft
Copy link

The password field's show/hide icon does not automatically update when the app theme changes (e.g., between light and dark themes). When switching themes, the icon remains unchanged, which affects the UI consistency.

Steps to Reproduce:

  1. Add a TextFieldPasswordShowHideAttachment to the TextField control for the password field, as shown below:
<material:TextField Title="Password" IsPassword="True">
    <material:TextField.Attachments>
        <material:TextFieldPasswordShowHideAttachment />
    </material:TextField.Attachments>
</material:TextField>
  1. Run the application with any theme, such as light.

  2. Change the theme to dark and observe the password field's show/hide icon.

Expected Behavior:
The show/hide icon should automatically update to match the current theme (light or dark).

Actual Behavior:
The icon does not change when the theme is switched, causing inconsistency with the application's overall theme.

Proposed Solution:
Consider using an extension method, SetAppTheme, on the icon to ensure it updates based on the current theme. This would enable the icon to match the theme dynamically.

@Pallav-sculptsoft
Copy link
Author

This will may help...

 private Path GetPathFromData(Geometry data)
    {
        var path = new Path
        {
            VerticalOptions = LayoutOptions.Center,
            Data = data,
        };

        // Set the Fill color based on the current theme
        path.SetAppThemeColor(Path.FillProperty,
            light: ColorResource.GetColor("OnBackground").WithAlpha(0.5f),
            dark: ColorResource.GetColor("OnBackgroundDark").WithAlpha(0.5f));

        return path;
    }

@enisn enisn added control-textfield bug-verified A bug that can be reproduced labels Oct 31, 2024
@enisn enisn added this to the v2.10 milestone Oct 31, 2024
@enisn
Copy link
Owner

enisn commented Oct 31, 2024

Thanks for showing the workaround @Pallav-sculptsoft

I got the issue, it is initialized with the current theme colors for better performance at the first. I can update it to use AppThemeBinding

@Pallav-sculptsoft
Copy link
Author

Thanks @enisn, Great to hear! Thanks for the response.

Could you please share the estimated timeline for this update and the targeted release version? This will help us plan accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-verified A bug that can be reproduced control-textfield
Projects
None yet
Development

No branches or pull requests

2 participants