question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to customize when md-error is shown

See original GitHub issue

Bug, feature request, or proposal:

Feature request

What is the expected behavior?

I would like to be able to customize when the md-error directive is visible. E.g. when ctrl.dirty && ctrl.invalid.

What is the current behavior?

As per #3560 my understanding is that the md-error is only shown when the control is: (isInvalid && (isTouched || isSubmitted))

What are the steps to reproduce?

See my Plunker.

  • Name1 is using md-error. Error will only show after control been touched.
  • Name2 is using an old workaround with md-hint. It can show error directly when dirty.

What is the use-case or motivation for changing an existing behavior?

For 99% of the time I believe the current implementation is the best behavior.

However, for special cases, you will need to be able to modify when errors are shown. For example instantly as the example from the Angular documentation.

Which versions of Angular, Material, OS, browsers are affected?

Angular v4.0.3 Material v2.0.0-beta.3

Is there anything else we should know?

I assume my request is not currently possible as my question on StackOverflow did not get any suggested answers.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
HopScotch47commented, Apr 24, 2017

Instead of configuring the whole behaviour to trigger a special case, you could simply do this:

const ctrl = this.form.controls['ctrlName'];
ctrl.markAsTouched();

for the control in question. This at least is what I do in such cases.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 6, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Mirror Column - monday.com Support
Customize your Mirror Column. When mirroring a column you can customize the way that it is displayed on the board where it will...
Read more >
Guide to Mirror Settings - Apache Maven
To configure a mirror of a given repository, you provide it in your settings file ( ${user.home}/.m2/settings.xml ), giving the new repository its...
Read more >
Mirror / CustomReflectable / CustomLeafReflectable - NSHipster
You can customize how instances of a type are reflected by adopting the CustomReflectable protocol and implementing the required customMirror ...
Read more >
Turn off Mirror my video in Microsoft Teams meetings to match ...
Meeting participants now have the option to stop mirroring the image of their video preview—the small preview window that allows you to see...
Read more >
Customise your Raspberry Pi magic mirror with modules
This controls where the module is displayed on the mirror. If a title is required, then 'title' allows you to change the text...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found