From 4716823e79e910e68a84a350be0c2d309b3d8e8d Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Thu, 26 Oct 2017 14:53:06 +0200 Subject: [PATCH] fix(all): hostData() attributes --- packages/core/src/components/menu/menu.tsx | 8 +++----- .../core/src/components/radio/radio-group.tsx | 8 +++----- .../core/src/components/range/range-knob.tsx | 16 +++++++--------- packages/core/src/components/tabs/tab-bar.tsx | 4 +--- packages/core/src/components/tabs/tab-button.tsx | 4 +--- packages/core/src/components/tabs/tab.tsx | 8 +------- 6 files changed, 16 insertions(+), 32 deletions(-) diff --git a/packages/core/src/components/menu/menu.tsx b/packages/core/src/components/menu/menu.tsx index 6542f702d5..9d72b0882f 100644 --- a/packages/core/src/components/menu/menu.tsx +++ b/packages/core/src/components/menu/menu.tsx @@ -165,11 +165,9 @@ export class Menu { hostData() { return { - attrs: { - 'role': 'navigation', - 'side': this.getSide(), - 'type': this.type - }, + 'role': 'navigation', + 'side': this.getSide(), + 'type': this.type, class: { 'menu-enabled': this._canOpen() } diff --git a/packages/core/src/components/radio/radio-group.tsx b/packages/core/src/components/radio/radio-group.tsx index 1e109ca624..3f9068bde9 100644 --- a/packages/core/src/components/radio/radio-group.tsx +++ b/packages/core/src/components/radio/radio-group.tsx @@ -169,11 +169,9 @@ export class RadioGroup { hostData() { return { - attrs: { - 'role': 'radiogroup', - 'aria-activedescendant': this.activeId, - 'aria-describedby': this.headerId - } + 'role': 'radiogroup', + 'aria-activedescendant': this.activeId, + 'aria-describedby': this.headerId }; } diff --git a/packages/core/src/components/range/range-knob.tsx b/packages/core/src/components/range/range-knob.tsx index fddb2f4e7a..93891659df 100644 --- a/packages/core/src/components/range/range-knob.tsx +++ b/packages/core/src/components/range/range-knob.tsx @@ -45,15 +45,13 @@ export class RangeKnob { style: { 'left': this.leftPos(this.ratio) }, - attrs: { - 'role': 'slider', - 'tabindex': this.disabled ? -1 : 0, - 'aria-valuemin': this.min, - 'aria-valuemax': this.max, - 'aria-disabled': this.disabled, - 'aria-labelledby': this.labelId, - 'aria-valuenow': this.val - } + 'role': 'slider', + 'tabindex': this.disabled ? -1 : 0, + 'aria-valuemin': this.min, + 'aria-valuemax': this.max, + 'aria-disabled': this.disabled, + 'aria-labelledby': this.labelId, + 'aria-valuenow': this.val }; } diff --git a/packages/core/src/components/tabs/tab-bar.tsx b/packages/core/src/components/tabs/tab-bar.tsx index 6fa3e7ce24..adfeff37b3 100644 --- a/packages/core/src/components/tabs/tab-bar.tsx +++ b/packages/core/src/components/tabs/tab-bar.tsx @@ -23,9 +23,7 @@ export class TabBar { hostData() { return { - attrs: { - 'role': 'tablist' - }, + 'role': 'tablist' class: { 'tabbar': true } diff --git a/packages/core/src/components/tabs/tab-button.tsx b/packages/core/src/components/tabs/tab-button.tsx index 8e7abea5fe..180ba2650c 100644 --- a/packages/core/src/components/tabs/tab-button.tsx +++ b/packages/core/src/components/tabs/tab-button.tsx @@ -33,9 +33,7 @@ export class TabButton { // class.tab-hidden return { - attrs: { - 'aria-selected': this.selectedIndex === this.index - }, + 'aria-selected': this.selectedIndex === this.index, class: { 'has-title': hasTitle, 'has-icon': hasIcon, diff --git a/packages/core/src/components/tabs/tab.tsx b/packages/core/src/components/tabs/tab.tsx index f2cd6b5461..244fb01b03 100644 --- a/packages/core/src/components/tabs/tab.tsx +++ b/packages/core/src/components/tabs/tab.tsx @@ -74,13 +74,7 @@ export class Tab { style: { display: !this.isSelected && 'none' || '' }, - attrs: { - 'role': 'tabpanel' - // 'id': _tabId, - // aria-labelledby: _btnId - }, - class: { - } + 'role': 'tabpanel' }; }