Skip to content

ARIAMixin properties should be nullable? #1119

Closed

Description

@h-joo

In the ARIAMixin definition of TS 4.4-rc, the aria* properties are non-nullable, but according to the spec draft for AOM aria reflection with the AriaAttributes mixin, it seems to be nullable. Should these types need to be reconsidered to be nullable?

Activity

  1. orta commented on Aug 25, 2021

    @orta
    Contributor

    Linking to microsoft/TypeScript#45571

    It looks like this is defined upstream as not being nullable: https://github.com/w3c/webref/blob/master/ed/idlnames/ARIAMixin.idl - which does seem to match that spec https://www.w3.org/TR/wai-aria-1.2/#AriaAttributes

    I think I agree that this is probably something we want to be classed as optional properties though, not quite decided. What does it look like to hit an error with this?

  2. h-joo commented on Aug 25, 2021

    @h-joo
    Author

    We used to have Element-like interface implementation which used to have their own ariaLabel/ariaExpanded properties. The type of the two properties is string|undefined which now have problem on assignment to Element type as Element starts to extend from ARIAMixin as well with having the properties as a string type.

    Sample error message:

    TS2345: Argument of type 'X' is not assignable to parameter of type 'Element'.
      Types of property 'ariaExpanded' are incompatible.
    
  3. saschanaz commented on Aug 27, 2021

    @saschanaz
    Contributor

    So, per the spec, assigning undefined is wrong and it will be converted to a string "undefined".

  4. jnurthen commented on Sep 17, 2021

    @jnurthen

    Note w3c/aria#1611 makes them nullable again.

  5. saschanaz commented on Sep 17, 2021

    @saschanaz
    Contributor

    Thanks, in that case it will be updated by webref within a few days.

  6. saschanaz commented on Nov 14, 2021

    @saschanaz
    Contributor

    Fixed by #1200

    @github-actions close

  7. github-actions commented on Nov 14, 2021

    @github-actions
    Contributor

    Closing because Kagami Sascha Rosylight (@saschanaz) is one of the code-owners of this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions