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

Entry ClearButton does not clear the text? #9954

Closed
FreakyAli opened this issue Sep 6, 2022 · 13 comments · Fixed by #12753
Closed

Entry ClearButton does not clear the text? #9954

FreakyAli opened this issue Sep 6, 2022 · 13 comments · Fixed by #12753
Assignees
Labels
area-controls-entry Entry fixed-in-7.0.81 Look for this fix in 7.0.81! fixed-in-7.0.100 fixed-in-7.0.101 fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! help wanted [up-for-grabs] Good issue for external contributors platform/android 🤖 platform/iOS 🍎 s/needs-attention Issue has more information and needs another look t/bug Something isn't working

Comments

@FreakyAli
Copy link

FreakyAli commented Sep 6, 2022

Description

So earlier today I was trying to use the internal property for an Entry to clear the text in it.

 <Entry
   Placeholder="This is a freaky entry"
   TextColor="Purple"
   ClearButtonVisibility="WhileEditing"
   FontSize="Large"
   Keyboard="Chat"/>

But when I click on it nothing seems to happen.

Am I missing something here?

Is this the intended behaviour?

If so how do I add the clear button functionality, I don't seem to find a command or a event for it...

Steps to Reproduce

  • Add an Entry to your XAML
  • Add the following property ClearButtonVisibility="WhileEditing"

Expected output: A clear button shows up while editing the Entry and on Click of the Clear button the text clears.
Actual output: the text does not clear on the click of clear button.

Link to public reproduction project repository

https://github.com/FreakyAli/MAUI.FreakyControls

Version with bug

6.0.400

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

Latest of both

Did you find any workaround?

No

Relevant log output

No response

@FreakyAli FreakyAli added the t/bug Something isn't working label Sep 6, 2022
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Sep 7, 2022
@PureWeen PureWeen added the help wanted [up-for-grabs] Good issue for external contributors label Sep 7, 2022
@PureWeen PureWeen added this to the Backlog milestone Sep 7, 2022
@ghost
Copy link

ghost commented Sep 7, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@jsuarezruiz
Copy link
Contributor

Cannot reproduce the issue with the latest version (net7 rc2) or the current main branch. Could you try again with the latest version?
issue-9954

@jsuarezruiz jsuarezruiz self-assigned this Oct 25, 2022
@jsuarezruiz jsuarezruiz added the s/needs-info Issue needs more info from the author label Oct 25, 2022
@ghost
Copy link

ghost commented Oct 25, 2022

Hi @FreakyAli. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@mjphillips1981
Copy link

I can confirm this is not working on the latest preview 5 build.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Oct 26, 2022
@mjphillips1981
Copy link

I can confirm this is not working on the latest preview 5 build.

Nevermind, I created a new project from the MAUI template and it does work on .NET 6.0 and .NET 7.0.

It does not work in my existing project. That I thought was using the latest preview version but it must not be.

@FreakyAli
Copy link
Author

@mjphillips1981 So is this working in the lastest preview and if so how do I confirm if I have the latest preview?

@mjphillips1981
Copy link

That's a good question. I am trying to figure out how to get it working in my already created project.
It only works when I create new projects as of right now.

@FreakyAli
Copy link
Author

I just did this and I can confirm I am facing the same issue, it only works on new projects but fails on existing projects

@mjphillips1981
Copy link

I just may have pinpointed this issue.
Currently I have a Frame around my entry. The clear button does not work.
If I remove the frame, the clear button works.
Also, this only seems to be a bug on Android. When I test on iOS all seem to work.

@mjphillips1981
Copy link

Nothing to do with frame, seems to be linked to Padding.

I think it has to do with Padding. My frame has a padding of 20. If I pressed to the left of the "X" roughly the length of the padding it will clear the text. If I change my padding to 0 clicking the "X" clears the text.

@FreakyAli
Copy link
Author

Nothing to do with frame, seems to be linked to Padding.

I think it has to do with Padding. My frame has a padding of 20. If I pressed to the left of the "X" roughly the padding length, it will clear the text. If I change my padding to 0 clicking the "X" clears the text.

I guess we do need the padding though right...

@AbanoubZak
Copy link

I have the same issue with padding, I need to click next to the X to be able to clear the text

@ismasanchez
Copy link

ismasanchez commented Dec 22, 2022

This is an absolute nightmare, I can't spend 2 hours debugging this bug for such a standard functionality... anyway, here are the steps to reproduce:

Create a brand new MAUI app with this code, clear button doesn't work properly:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MauiBug.MainPage">

    <ScrollView>
        <VerticalStackLayout
            Spacing="25"
            Padding="30,0"
            VerticalOptions="Center">

            <Image
                Source="dotnet_bot.png"
                SemanticProperties.Description="Cute dot net bot waving hi to you!"
                HeightRequest="200"
                HorizontalOptions="Center" />

            <Label
                Text="Hello, World!"
                SemanticProperties.HeadingLevel="Level1"
                FontSize="32"
                HorizontalOptions="Center" />

            <Label
                Text="Welcome to .NET Multi-platform App UI"
                SemanticProperties.HeadingLevel="Level2"
                SemanticProperties.Description="Welcome to dot net Multi platform App U I"
                FontSize="18"
                HorizontalOptions="Center" />

            <Button
                x:Name="CounterBtn"
                Text="Click me"
                SemanticProperties.Hint="Counts the number of times you click"
                Clicked="OnCounterClicked"
                HorizontalOptions="Center" />

            <Border Stroke="black"
            StrokeThickness="1"
            BackgroundColor="Transparent">
                <Border.StrokeShape>
                    <RoundRectangle CornerRadius="10,10,10,10" />
                </Border.StrokeShape>
                <Entry
                        ClearButtonVisibility="WhileEditing"/>
            </Border>

        </VerticalStackLayout>
    </ScrollView>

</ContentPage>

Remove Padding in VerticalStackLayout, now it works.

Here's my workload:

Installed Workload Id Manifest Version Installation Source

maui-windows 7.0.52/7.0.100 VS 17.4.33205.214
maui-maccatalyst 7.0.52/7.0.100 VS 17.4.33205.214
maccatalyst 16.1.1477/7.0.100 VS 17.4.33205.214
maui-ios 7.0.52/7.0.100 VS 17.4.33205.214
ios 16.1.1477/7.0.100 VS 17.4.33205.214
android 33.0.4/7.0.100 VS 17.4.33205.214
maui-android 7.0.52/7.0.100 VS 17.4.33205.214

rmarinho pushed a commit that referenced this issue Jan 30, 2023
…n has been hit Fixes #9954 (#12936)

Co-authored-by: E.Z. Hart <hartez@gmail.com>
@ghost ghost locked as resolved and limited conversation to collaborators Feb 18, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! label Feb 22, 2023
@samhouts samhouts modified the milestones: Backlog, 8.0-preview1 Feb 22, 2023
@samhouts samhouts added the fixed-in-7.0.81 Look for this fix in 7.0.81! label Apr 12, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-entry Entry fixed-in-7.0.81 Look for this fix in 7.0.81! fixed-in-7.0.100 fixed-in-7.0.101 fixed-in-8.0.0-preview.1.7762 Look for this fix in 8.0.0-preview.1.7762! help wanted [up-for-grabs] Good issue for external contributors platform/android 🤖 platform/iOS 🍎 s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants