Skip to content

Clarify use of non-standard "align" attribute for mat-dialog-actions #18479

Closed

Description

@cwatzl

Documentation Feedback

Documentation suggests using the align attribute to align the content of mat-dialog-actions directives to the middle or right. However, align is an obsolete HTML attribute and not valid HTML5, and my IDE's static code analysis tools rightfully complain about using it. If using align really is the right way of doing this regardless of W3C standards, this should be clarified in the docs (and possibly be explicitly declared as a property of the MatDialogActions directive to make IDEs stop complaining).

Affected documentation page: https://material.angular.io/components/dialog/overview

Activity

  1. added
    docs
    on Feb 12, 2020
  2. crisbeto commented on Feb 17, 2020

    @crisbeto
    Member

    The dialog isn't meant to use the align attribute, but align is a custom attribute. It didn't make sense to turn it into an input, because it's only used for styling.

  3. added
    needs triage
    on May 20, 2020
  4. added
    P4
    and removed
    needs triage
    on May 26, 2020
  5. devversion commented on May 26, 2020

    @devversion
    Member

    I would agree that this is confusing. Given that align is not standard for HTMLDivElement, I think it would make sense to turn this into an input w/ documentation (that would also help w/ type-checking; IDE's and bindings).

    https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement

  6. added
    good first issue
    on May 26, 2020
  7. PooSham commented on Dec 17, 2020

    @PooSham
    Contributor

    I could take this as my first issue I think. A fun christmas activity 😁🎅

  8. PooSham commented on Dec 21, 2020

    @PooSham
    Contributor

    Question: Would adding an input and removing the css code count as feat, fix or docs in the type when I commit? I think it's hard to classify things like this.

  9. PooSham commented on Dec 22, 2020

    @PooSham
    Contributor

    As of now, my solution would be a breaking for those using [attr.align]="x". I'd assume this is a very special case, probably only used for demo apps. Should I solve it in some other way, such as adding an input that is called justify and keep the old scss code for backwards compability?

  10. added 4 commits that reference this issue on Dec 25, 2020
    c101f7f
    c0c8c87
    72e1f79
    7b51418
  11. 3 remaining items

  12. added a commit that references this issue on Feb 1, 2022
  13. angular-automatic-lock-bot commented on Mar 14, 2022

    @angular-automatic-lock-bot

    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.

  14. locked and limited conversation to collaborators on Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P4area: material/dialogdocsgood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions