ember-paper icon indicating copy to clipboard operation
ember-paper copied to clipboard

Add input with tooltip

Open Shadowere opened this issue 5 years ago • 2 comments

#1087 Adds input with tooltip

  • Adds tooltips to input;
  • Adds input with tooltip to demo;
  • Adds tests for input with tooltip;

Shadowere avatar Jun 04 '19 18:06 Shadowere

All of this would be solved if we had named blocks instead of a single block. This way we could customize the label with whatever content we want, including an icon + tooltip.

Since named blocks are not a reality, my suggestion is that we accept a labelComponent argument, which paper-input would render if truthy. Example:

{{paper-input
  labelComponent=(component "tooltip-label" text="myLabel" tooltip="My tooltip")
  value=myValue
  onChange=(action (mut myValue))
}}

In the paper-input.hbs template, we would do something like:

{{#if labelComponent}}
  {{component labelComponent inputElementId=inputElementId required=required}}
{{else if label}}
  <label for={{inputElementId}} class={{if required "md-required"}}>{{label}}</label>
{{/if}}

In this case, you could have your own tooltip-label component in which you could do all sorts of crazy stuff.

I can't merge this PR the way it is now because it's too specific. It assumes that people want an info icon, etc.

Let me know what you think.

miguelcobain avatar Jun 13 '19 15:06 miguelcobain

I agree that providing a custom labelComponent will be cleaner and more versatile. I'll change it up soon enough

Shadowere avatar Jun 27 '19 15:06 Shadowere