Enhancement request for TokenField
https://wpcalypso.wordpress.com/devdocs/design/token-fields.
While working on https://github.com/Automattic/wp-calypso/pull/11809, I had the need to add placeholder text to the token field, to act as a more contextual description. I want it to be super clear that you have to comma separate here.
For a visual reference, the tokenfield is the one labeled Values
:
Is this something we could add? Curious to hear @aduth @mtias @MichaelArestad's thoughts.
I'm happy to handle this if it's something we want.
I'd mentioned this being a pain, but after looking closer, there is an input being rendered by the component, it's just that the the selected tokens are shown outside of it. So to achieve a placeholder effect it might just be a matter of applying the placeholder prop only if there are currently no tokens assigned to the field. The condition is needed because the field is technically "empty" even if there are tokens assigned but if there is no in-progress text.
Thanks, @aduth.
@justinshreve: Sounds good, I would say this would be great to add, but not ASAP. It would be good to have this in place for Variations before moving onto a different section.
Most helpful comment
I'd mentioned this being a pain, but after looking closer, there is an input being rendered by the component, it's just that the the selected tokens are shown outside of it. So to achieve a placeholder effect it might just be a matter of applying the placeholder prop only if there are currently no tokens assigned to the field. The condition is needed because the field is technically "empty" even if there are tokens assigned but if there is no in-progress text.