Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

input: ng-messages do not work if animation is disabled #10240

Closed

Description

@nikclayton

Actual Behavior:

With a form like:

<form name="f">
  <md-input-container class="md-block">
    <label>Some text</label>
    <input type="text" name="i" placeholder="Enter something" required />
    <div ng-messages="f.i.$error">
      <div ng-message="required">This field is required.</div>
    </div>
  </md-input-container>
</form>

Everything works -- tab in to the field, tab out, and the field behaves as expected. Specifically:

  1. The placeholder text "Enter something" appears in red.
  2. The form field is underlined in red.
  3. The text "This field is required." appears underneath the field.

However, if your app turns off animation by, for example, injecting a $animate instance and calling $animate.enabled(false), (1) and (2) still occur, but (3) no longer happens -- the ng-message does not appear.

This is a regression from 1.0, where it did work.

CodePen (or steps to reproduce the issue): *

If you change that to $animate.enabled(true) the errors will start appearing again.

Angular Versions: *

  • Angular Version: 1.5.x
  • Angular Material Version: 1.1.x

Additional Information:

  • Browser Type: * Chrome.
  • Browser Version: * 55.0.2883.87
  • OS: * Ubuntu 14.04
  • Stack Traces: N/A

Activity

  1. added
    g3: reported
    on Jan 9, 2017
  2. self-assigned this
    on Jan 10, 2017
  3. nikclayton commented on Jan 10, 2017

    @nikclayton
    Author

    Suspect that cf7f21a is the culprit, which unconditionally uses $animate() to add new classes instead of checking to see if animation is enabled.

  4. clshortfuse commented on Jan 10, 2017

    @clshortfuse
    Contributor

    @nikclayton Correct. I'm the process of moving the animations to pure CSS. It just needs more testing but I'll probably have it ready for today.

    The reason why we moved to $animate was due to a flicker bug. We can now move back to CSS because of the newer ng-enter-prepare class that was added since.

  5. added
    has: Pull Request
    on Jan 10, 2017
  6. removed
    has: Pull Request
    on Mar 20, 2017
  7. topherfangio commented on Mar 20, 2017

    @topherfangio
    Contributor

    I've removed the has: Pull Request label because the PR didn't account for many instances. I think we should just check if animation is enabled and if not, call element.addClass(). I will look into this soon.

  8. added
    needs: investigation
    P2: required
    on Mar 20, 2017
  9. 10 remaining items

  10. modified the milestones: 1.1.12, 1.1.13 on Jan 3, 2019
  11. modified the milestones: 1.1.13, 1.1.14 on Feb 10, 2019
  12. changed the title [-]ng-messages + ngmaterial 1.1 do not work if animation is disabled[/-] [+]input: ng-messages do not work if animation is disabled[/+] on Feb 12, 2019
  13. removed
    needs: investigation
    on Feb 12, 2019
  14. Splaktar commented on Feb 12, 2019

    @Splaktar
    Contributor

    I updated the CodePen to 1.1.12 and it appears to be working properly. It looks like this was fixed indirectly already.

  15. modified the milestones: 1.1.14, 1.1.12 on Feb 12, 2019
  16. clshortfuse commented on Feb 12, 2019

    @clshortfuse
    Contributor

    Looks like it was fixed in 0151b4b

    The commit didn't closed the issue. I'm not entirely sure why.

  17. Splaktar commented on Feb 12, 2019

    @Splaktar
    Contributor

    @clshortfuse thank you! It didn't close it because you need a Fixes for each issue #. I.e. Fixes #. Fixes #.

  18. modified the milestones: 1.1.12, 1.1.5 on Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2: requiredg3: reportedresolution: fixedseverity: regression

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions