cfpb / design-manual

⚠️ THIS REPO IS DEPRECATED ⚠️ A set of design principles and standards for the Consumer Financial Protection Bureau.
https://cfpb.github.io/design-manual/
Creative Commons Zero v1.0 Universal
98 stars 71 forks source link

The Future of "Button inside input" #441

Open mistergone opened 7 years ago

mistergone commented 7 years ago

If you check out the current version of our cf-forms portion of Capital Framework, you will find our "Button Inside Input" style:

screen shot 2016-09-16 at 12 03 06 pm

But @KimberlyMunoz rightfully pointed out that the spacing of this element is very precarious, and translations may break it. I'm only fluent in English, so I won't take a stab at "Clear" in another language, but here's the Klingon terms for "remove words":

screen shot 2016-09-16 at 12 09 11 pm

Translations are a problem, but also any text other than "Clear X" would break our current implementation - so "Clear text" would also break it.

While moving this code into atomic design, I attempted to make the button variable length. I was able to implement this, but the design broke when the input received focus. My attempts to fix the focus issue eventually ended with success, but only in a few browsers. After a lot of trying, I still wasn't able to make it work in Internet Explorer. (Some of my failures can be found in the discussion of the PR here).

For now, we've stopped trying to fix this problem for our next release. However, this problem will come back to us when we try internationalization for certain. So I'd like to propose the following:

I'm all too happy to answer questions, go over each solution I tried, and otherwise get or give feedback about the intractable problems we've encountered trying to implement this design in a way that allows the "Clear" text to be variable width!

caheberer commented 7 years ago

@mistergone where were you trying to implement this? I'm unfamiliar with us using this convention. Is a clear even necessary?

jimmynotjim commented 7 years ago

@mistergone didn't we end up resolving this during the move to v4?

jimmynotjim commented 7 years ago

@mistergone is this still a concern or can we close it?

@caheberer I should have mentioned, this is used in the search bar on cfgov-refresh and is documented in Capital Framework, but I can't find it in the Design Manual. It should probably be added under Form Fields, but I'm not sure

nataliafitzgerald commented 6 years ago

@jimmynotjim - Do we only use this for global search?

Following up on @caheberer's comment - Do we think that clear is necessary?

jimmynotjim commented 6 years ago

@nataliafitzgerald Yes, as far as I know it's only been used for the global search.