feat(segment): add keyboard navigation, add selectOnFocus property to control selection follow focus behavior (#23590)

resolves #23520
This commit is contained in:
William Martin
2021-07-20 16:45:17 -04:00
committed by GitHub
parent 82d6275f3d
commit b6c53e539b
9 changed files with 178 additions and 34 deletions

View File

@@ -87,15 +87,7 @@ export class SegmentButton implements ComponentInterface, ButtonInterface {
}
private get tabIndex() {
if (this.disabled) { return -1; }
const hasTabIndex = this.el.hasAttribute('tabindex');
if (hasTabIndex) {
return this.el.getAttribute('tabindex');
}
return 0;
return this.checked && !this.disabled ? 0 : -1;
}
render() {