MDB 8 - mdb-checkbox with tabindex=-1


Topic: MDB 8 - mdb-checkbox with tabindex=-1

mdb2 pro asked 5 years ago

When converting to mdb-checkbox tabindex=-1 stopped working and the checkbox returned to be a tab stop

<mdb-checkbox formControlName="cb1" tabindex=-1 (change)="onChange()">check</mdb-checkbox>

Arkadiusz Idzikowski staff commented 5 years ago

We can't reproduce this problem on our end. The checkbox with tabindex set to -1 is not focusable. Please try to add the bindings [tabindex]="-1".


mdb2 pro answered 5 years ago

OK, let me rephrase

Tab skips the checkbox

Shift-Tab stops on the checkbox

P.S. [tabindex]="-1" didn't effect the behavior.


Damian Gemza staff answered 5 years ago

Dear @mdb2

There's no tabindex input on mdb-checkbox component.

There's a tabIndex input which works fine - with setting the tabIndex="-1" on mdb-checkbox element, I'm not able to focus it through tab or shift+tab.

Best Regards,

Damian


mdb2 pro commented 5 years ago

Well, it doesn't work. shift-tab stops on it

Is my code, above, OK ?


Damian Gemza staff answered 5 years ago

Dear @mdb2

As I said in this answer, it's not. Because in mdb-checkbox there's no tabindex input.

There's a tabIndex input. You have a typo in input name. Correct it and it should be working as expected.

Best Regards,

Damian


mdb2 pro answered 5 years ago

OK

  1. There was indeed a typo in tabindex instead of tabIndex (lower case i)

  2. It did solve the issue for mdb-checkbox so it DOES work on it, not only on input

PS. How do you style comp name "mdb-checkbox" with red letters and gray background here in the questions ?


Arkadiusz Idzikowski staff commented 5 years ago

You need to use backtick "`" before and after the text.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 8.0.0
  • Device: NA
  • Browser: NA
  • OS: NA
  • Provided sample code: No
  • Provided link: No
Tags