The Wayback Machine - https://web.archive.org/web/20200606043154/https://github.com/microsoft/react-native-windows/issues/4080
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

TextInput's "clearButtonMode" does not seem to be implemented #4080

Open
jagorrin opened this issue Feb 11, 2020 · 5 comments
Open

TextInput's "clearButtonMode" does not seem to be implemented #4080

jagorrin opened this issue Feb 11, 2020 · 5 comments

Comments

@jagorrin
Copy link
Collaborator

@jagorrin jagorrin commented Feb 11, 2020

Environment

If you are using latest version:

  1. react-native -v: 0.60.6
  2. react-native run-windows --info:
    System:
    OS: Windows 10 10.0.18363
    CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
    Memory: 18.01 GB / 31.84 GB
    Binaries:
    Node: 10.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.13.7 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
    react: 16.8.6 => 16.8.6
    react-native: 0.60.6 => 0.60.6
    react-native-windows: 0.60.0-vnext.133 => 0.60.0-vnext.133
    rnpm-plugin-windows: 0.3.5 => 0.3.5
    Installed UWP SDKs:
    10.0.14393.0
    10.0.15063.0
    10.0.16299.0
    10.0.17134.0
    10.0.17749.0
    10.0.17763.0
    10.0.18362.0

Then, specify:

  • Target Platform Version(s): 10.0.18362.0
  • Target Device(s): Desktop
  • Visual Studio Version: 2017
  • Build Configuration: Debug

Steps to Reproduce

Create a project using react-native-windows that includes a single-line TextInput. Provide the prop "clearButtonMode" and set it to "never".

Expected Behavior

The TextInput should never display a clear button.

Actual Behavior

The TextInput displays a clear button when the TextInput is not empty and is in focus.

@harinikmsft
Copy link
Member

@harinikmsft harinikmsft commented Feb 13, 2020

clearButtonMode is an iOS only prop which is likely why we didn't get to it so far. However, this is likely a supported prop in Windows/XAML and we should be able to plumb it through.

@KAnder425
Copy link
Contributor

@KAnder425 KAnder425 commented Mar 5, 2020

+1 for this issue. Our app needs to disable TextInput's built-in clear button in lieu of a 'fancier' clear button for a specific scenario.

@KAnder425
Copy link
Contributor

@KAnder425 KAnder425 commented Mar 6, 2020

Another note here; while the clearButtonMode is an iOS-only property, the default behavior on both Android and iOS is to never display a 'clear' or 'delete' button (eg. clearButtonMode='never')

That makes RNW an outlier. Anyone making sophisticated cross-platform apps will need to workaround this problem on RNW for a very basic element.

@KAnder425
Copy link
Contributor

@KAnder425 KAnder425 commented Mar 7, 2020

Here's an example...
We have a bar with a TextInput followed by a color-matched button that shifts from 'execute search' to 'exit search' with associated accessibility labels. We can't replicate that with the built-in 'clear' button in RNW's TextInput, so we need to remove the built-in button.
double x plain background

@kmelmon
Copy link
Contributor

@kmelmon kmelmon commented Mar 12, 2020

Note that there isn't a property on TextBox to control showing/hiding this button. We may be able to use VisualTreeHelper to find/hide it, just need to confirm this will work reliably across all versions we support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.