FreakyAli
FreakyAli

Reputation: 16479

MAUI Entry ClearButton does not clear the text?

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...

Version details:

When I run dotnet --version it says I am running 6.0.400

And in my VS about I have the following configuration:

Visual Studio Enterprise 2022 for Mac Preview
Version 17.4 Preview (17.4 build 715)
Installation UUID: 2aec5c48-b274-4de3-a48e-fb97472a4bd5

Runtime
.NET 6.0.5 (64-bit)
Architecture: Arm64

Roslyn (Language Service)
4.4.0-1.22371.1+c07f2571612b471671c809b5b0db59b0c37aab57

NuGet
Version: 6.2.1.2

.NET SDK (Arm64)
SDK: /usr/local/share/dotnet/sdk/6.0.400/Sdks
SDK Versions:
    6.0.400
    6.0.301
MSBuild SDKs: /Applications/Visual Studio (Preview).app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET SDK (x64)
SDK Versions:
    3.1.422
    3.1.420

.NET Runtime (Arm64)
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    6.0.8
    6.0.6

.NET Runtime (x64)
Runtime: /usr/local/share/dotnet/x64/dotnet
Runtime Versions:
    3.1.28
    3.1.26

Xamarin.Profiler
Version: 1.8.0.19
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Apple Developer Tools
Xcode 13.4.1 (20504)
Build 13F100

Xamarin.Mac
Version: 8.12.0.2 (Visual Studio Enterprise)
Hash: 87f98a75e
Branch: d17-3
Build date: 2022-07-25 20:18:54-0400

Xamarin.Android
Version: 13.0.99.36 (Visual Studio Enterprise)
Commit: xamarin-android/main/b4998c8
Android SDK: /Users/jimtiyg/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        12.0 (API level 31)
        11.0 (API level 30)

SDK Command-line Tools Version: 7.0
SDK Platform Tools Version: 33.0.2
SDK Build Tools Version: 33.0.0

Build Information: 
Mono: dffa5ab
Java.Interop: xamarin/java.interop/main@032f1e71
SQLite: xamarin/sqlite/3.39.2@40e8743
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@9c641b3

Microsoft Build of OpenJDK
Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
11.0.12
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Eclipse Temurin JDK
Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
1.8.0.302
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 17.4.0.24
Hash: b3b6672
Branch: remotes/origin/HEAD~1
Build date: 2022-08-04 16:29:21 UTC

Android Device Manager
Version: 0.0.0.1179
Hash: 0f220c0
Branch: main
Build date: 2022-08-04 16:29:21 UTC

Xamarin Designer
Version: 17.4.0.32
Hash: 439b92ed7b
Branch: remotes/origin/d17-4
Build date: 2022-08-04 16:29:17 UTC

Xamarin.iOS
Version: 15.12.0.2 (Visual Studio Enterprise)
Hash: 87f98a75e
Branch: d17-3
Build date: 2022-07-25 20:18:55-0400

Build Information
Release ID: 1704000715
Git revision: 09071dadfc1b81e4f0e2c9505cd8a5ef0b41d312
Build date: 2022-08-04 16:26:39+00
Build branch: release-17.4
Build lane: release-17.4

Operating System
Mac OS X 12.5.1
Darwin 21.6.0 Darwin Kernel Version 21.6.0
    Wed Aug 10 14:28:23 PDT 2022
    root:xnu-8020.141.5~2/RELEASE_ARM64_T6000 arm64

Upvotes: 3

Views: 2660

Answers (1)

Leandro Toloza
Leandro Toloza

Reputation: 2020

I tested on my actual project (preview version, same as you), and i could replicate your error (in standar version it works) so i made this:

1- Open package manager console

2- dotnet tool install -g Redth.Net.Maui.Check

3- maui-check

4- Check my version (if it's the last one)

And now My entry clear button is Working:

<Entry ClearButtonVisibility="WhileEditing"
       BackgroundColor="AliceBlue"
       Placeholder="Random Text"/>

Try that please! Package Reference

Upvotes: 2

Related Questions