bitplatform icon indicating copy to clipboard operation
bitplatform copied to clipboard

Simple clear contents icon at the end of a text field

Open nhwilly opened this issue 2 months ago • 2 comments

I would like to see a small x clear button on the right of a BitTextField that would allow the value to be reset to empty.

Here's a sample from another package:

Image

Possible feature set:

  1. Parameter to switch on this behavior is Clear or something like that.
  2. Only show the clear icon when the field has a value in it.
  3. Optional ClearIonName parameter to replace the x if passed.
  4. Optional OnClear parameter allowing a function to be passed in and executed before the value is cleared (allowing a capture of the current value before clearing it with a bool return so the clear can be blocked.
  5. Retain SuffixTemplate, Suffix parameters and have them behave as they do now.

When I tried to use the ChromeClose icon, I noticed that I couldn't make it as small as I wanted, but I haven't considered mobile size implications and you guys probably have. I think it's the correct size for modals and such, but it seems a little big for a text field.

The sample above demonstrates the look. If you visit the MudBlazor site, you can see this field type in action.

If this list is too long, just features 1 and 2 would be fabulous.

Thank you for considering.

Originally posted by @nhwilly in https://github.com/bitfoundation/bitplatform/discussions/11840

nhwilly avatar Dec 08 '25 14:12 nhwilly

Hello there! I'm a wiki 🤖.

Based on the content of this thread, I've found a potentially relevant wiki page for you!

View Wiki Page

I hope this helps!

github-actions[bot] avatar Dec 08 '25 14:12 github-actions[bot]

Thanks for contacting us. We're investigating this issue. We'll let you know if it's possible to work on this issue.

msynk avatar Dec 08 '25 20:12 msynk