Skip to content

bug(CdkOption): tabindex does not allow string #31595

@shhdharmen

Description

@shhdharmen

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

CdkOption's tabindex input should allow string as input so that developers do not have to always use property binding.

Reproduction

Not needed

Expected Behavior

<li tabindex="-1" cdkOption></li> should work without any issue

Actual Behavior

<li tabindex="-1" cdkOption></li> gives error:

Type 'string' is not assignable to type 'number'.ngtsc(2322)

Environment

  • Angular: 20
  • CDK/Material: 20
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsarea: cdk/listbox

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions