fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

TextField: Add clear button and icon support, deprecate SearchBox

Open cschleiden opened this issue 9 years ago • 7 comments

TextField supports a focus method which sets focus to the wrapped input element, SearchBox is missing such functionality.

cschleiden avatar Dec 06 '16 21:12 cschleiden

Funny you brought that up. We're considering collapsing SearchBox into TextField. They really aren't THAT different. If TextField had an optional clear button and an info icon, they'd be identical. So we are considering just deprecating it all together and adding a few features to TextField.

What do you think? Also can you provide some use cases where you're using SearchBox? (A screenshot would help our designers to consider your scenario.)

dzearing avatar Dec 07 '16 01:12 dzearing

Yep, that would make perfect sense for us.

Right now we are looking at a scenario where we use either SearchBox or TextField depending on the type of a field being edited, and instead of switching between the two controls, I could see us just changing placeholder/icon.

Some very early explorations in that direction: image image

cschleiden avatar Dec 07 '16 01:12 cschleiden

Renaming the item to replace SearchBox with TextField so there is way less inconsistency and confusion.

dzearing avatar Dec 09 '16 17:12 dzearing

Flagging as 'needs-design' to make sure we discuss this in a future design meeting. As far as the designers are concerned, TextField (even with a search icon and used in a search experience) is distinct from SearchBox. How this gets implemented is up to us, so we might have a TextField variant or use TextField within SearchBox, but we need to find out more about the requirements before making any changes to SearchBox.

We have another bug to fix the positioning of icons in TextField and I've confirmed that TextField should not have a clear button.

mikewheaton avatar Dec 10 '16 18:12 mikewheaton

So from #650, there will be no merge of text- and searchbox? Do we still need this item as a "needs-design" reminder or can I change it back to the original issue? I need that focus method :)

cschleiden avatar Jan 04 '17 17:01 cschleiden

@cschleiden: Let's get the focus method added to SearchBox, but hold off on merging these components until we've had a chance to discuss with the design team. Thanks!

mikewheaton avatar Jan 04 '17 17:01 mikewheaton

Search box has been revamped since this issue was opened. As of now this is not something we will pursue.

gokunymbus avatar Jan 11 '18 19:01 gokunymbus