Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MatChip tabIndex doesn't accept static values #20026

Closed
hisham opened this issue Jul 17, 2020 · 1 comment · Fixed by #20037
Closed

MatChip tabIndex doesn't accept static values #20026

hisham opened this issue Jul 17, 2020 · 1 comment · Fixed by #20037
Assignees
Labels
area: material/chips P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@hisham
Copy link

hisham commented Jul 17, 2020

Reproduction

https://stackblitz.com/edit/components-issue-rgly57?file=src%2Fapp%2Fexample-component.html

(does not reproduce on stackblitz but if you download the above code and run locally you'll see it)

Expected Behavior

Should run fine with strict template checking on (strictTemplates:true).

Actual Behavior

I get this error:

    ERROR in src/app/example-component.html:10:13 - error TS2345: Argument of type '{ tabIndex: string; color: any; disableRipple: any; selected: any; value: any; selectable: any; disabled: any; removable: any; }' is not assignable to parameter of type 'Pick<MatChip, "color" | "value" | "tabIndex"> | { disableRipple: BooleanInput; selected: BooleanInput; selectable: BooleanInput; disabled: BooleanInput; removable: BooleanInput; }'.
      Types of property '"tabIndex"' are incompatible.
        Type 'string' is not assignable to type 'number | undefined'.
    
    10             <mat-chip
                   ~~~~~~~~~
    11               tabIndex="0"
       ~~~~~~~~~~~~~~~~~~~~~~~~~~
    12 
       
    13             >

Environment

  • Angular: 10.0.3
  • CDK/Material: 10.0.1
  • Operating System (e.g. Windows, macOS, Ubuntu): OSX
@hisham hisham added the needs triage This issue needs to be triaged by the team label Jul 17, 2020
@jelbourn jelbourn added area: material/chips good first issue This issue is a good place to start for first time contributors to the project help wanted The team would appreciate a PR from the community to address this issue P4 A relatively minor issue that is not relevant to core functions and removed needs triage This issue needs to be triaged by the team labels Jul 17, 2020
@jelbourn jelbourn changed the title Shouldn't tabindex in mat-chip be number not string? MatChip tabIndex doesn't accept static values Jul 17, 2020
@jelbourn jelbourn added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed P4 A relatively minor issue that is not relevant to core functions labels Jul 17, 2020
@crisbeto crisbeto self-assigned this Jul 18, 2020
@crisbeto crisbeto removed good first issue This issue is a good place to start for first time contributors to the project help wanted The team would appreciate a PR from the community to address this issue labels Jul 18, 2020
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 18, 2020
All the components that were implementing the `HasTabIndex` input weren't allowing coercion.

Fixes angular#20026.
wagnermaciel pushed a commit that referenced this issue Jul 24, 2020
All the components that were implementing the `HasTabIndex` input weren't allowing coercion.

Fixes #20026.
wagnermaciel pushed a commit that referenced this issue Jul 24, 2020
All the components that were implementing the `HasTabIndex` input weren't allowing coercion.

Fixes #20026.

(cherry picked from commit 333e609)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 24, 2020
wagnermaciel pushed a commit to wagnermaciel/components that referenced this issue Jan 14, 2021
All the components that were implementing the `HasTabIndex` input weren't allowing coercion.

Fixes angular#20026.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/chips P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants