1

Given the following

  • mat-button directive responds to a disabled attribute / input
  • matTooltip directive responds to a disabled attribute / input

Is it possible to create a material button element that is disabled, but has a non-disabled tooltip associated with it? i.e. is it possible to namespace / target a component input so that it only applies to the mat-button directive and not the matTooltip directive?

In the following example, both the button AND tooltip are disabled:

<button mat-button matTooltip="first enter email address" [disabled]=true>
  Next
</button>

I can't seem to disable just the button and not the tooltip. It's possible that this is a bug in the current matTooltip implementation.

Thanks!!

Using angular 4.4.6 and material 2-beta.12

1 Answer 1

1

There is no way to resolve input name conflicts except renaming the inputs.

You can use a helper element and split the component and directive so that they don't share the same host element:

<span matTooltip="first enter email address">
  <button mat-button  [disabled]=true>
    Next
  </button>
</span>
Sign up to request clarification or add additional context in comments.

1 Comment

Apparently I need to wait 10 minutes to accept your answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.