-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(slide-toggle): support native tabindex attribute #6613
fix(slide-toggle): support native tabindex attribute #6613
Conversation
Currently the slide-toggle only allows changing the tabIndex using the `tabIndex` binding. Using the native `tabindex` attribute doesn't have any affect. With this change the native tabindex property will be respected. References angular#6465
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I like the mixin, just want to tweak the name
import {CanDisable} from './disabled'; | ||
|
||
/** @docs-private */ | ||
export interface CanTabIndex { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe CanRecieveFocus
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed the feedback discussed per Chat.
|
||
get tabIndex(): number { return this.disabled ? -1 : this._tabIndex || defaultTabIndex; } | ||
set tabIndex(value: number) { | ||
if (typeof value !== 'undefined') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do nothing for undefined
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that doesn't really have any affect with the fallback. I've updated the getter/setter to handle the fall back better (also with a comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently the slide-toggle only allows changing the tabIndex using the
tabIndex
binding. Using the nativetabindex
attribute doesn't have any affect. With this change the native tabindex property will be respected.Note: The
tabIndex
mixin is more like a proposal to ensure that the tabIndex property will be handled consistent across Material components.References #6465