@playkit-js/playkit-js-ui 0.82.4 → 0.82.5-canary.0-e0f35fd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -177,10 +177,10 @@ class DropDown extends Component<any, any> {
|
|
|
177
177
|
props.pushRef(el);
|
|
178
178
|
}
|
|
179
179
|
}}
|
|
180
|
-
role="
|
|
181
|
-
aria-haspopup="
|
|
180
|
+
role="combobox"
|
|
181
|
+
aria-haspopup="listbox"
|
|
182
182
|
aria-expanded={this.state.dropMenuActive ? 'true' : 'false'}
|
|
183
|
-
aria-labelledby={
|
|
183
|
+
aria-labelledby={props.name}
|
|
184
184
|
className={style.dropdownButton}
|
|
185
185
|
onClick={this.onClick}
|
|
186
186
|
onKeyDown={this.onKeyDown}
|
|
@@ -167,29 +167,30 @@ class Menu extends Component<MenuProps & WithEventManagerProps, any> {
|
|
|
167
167
|
* @returns {React$Element} - component element
|
|
168
168
|
* @memberof Menu
|
|
169
169
|
*/
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
170
|
+
renderNativeSelect(labelledby: string): VNode<any> {
|
|
171
|
+
let classes = this.props.hideSelect ? style.mobileHiddenSelect : '';
|
|
172
|
+
classes += ` ${style.dropdown}`;
|
|
173
|
+
const selectedValue = this.props.options.findIndex(o => this.isSelected(o));
|
|
174
|
+
return (
|
|
175
|
+
<select
|
|
176
|
+
aria-labelledby={labelledby}
|
|
177
|
+
ref={el => {
|
|
178
|
+
if (this.props.pushRef) {
|
|
179
|
+
this.props.pushRef(el);
|
|
180
|
+
}
|
|
181
|
+
}}
|
|
182
|
+
className={classes}
|
|
183
|
+
value={selectedValue}
|
|
184
|
+
onChange={this.onChange}
|
|
185
|
+
>
|
|
186
|
+
{this.props.options.map((o, index) => (
|
|
187
|
+
<option value={index} key={index}>
|
|
188
|
+
{o.label}
|
|
189
|
+
</option>
|
|
190
|
+
))}
|
|
191
|
+
</select>
|
|
192
|
+
);
|
|
193
|
+
}
|
|
193
194
|
|
|
194
195
|
/**
|
|
195
196
|
* if mobile device detected, renders the native select element.
|
|
@@ -201,13 +202,11 @@ class Menu extends Component<MenuProps & WithEventManagerProps, any> {
|
|
|
201
202
|
*/
|
|
202
203
|
render(props: any): VNode<any> {
|
|
203
204
|
props.clearAccessibleChildren();
|
|
204
|
-
const menuItemRole = "menuitem";
|
|
205
|
-
const menuItemRadioRole = "menuitemradio";
|
|
206
205
|
return props.isMobile || props.isSmallSize ? (
|
|
207
206
|
this.renderNativeSelect(props.labelledby)
|
|
208
207
|
) : (
|
|
209
208
|
<div
|
|
210
|
-
role="
|
|
209
|
+
role="listbox"
|
|
211
210
|
onKeyDown={props.handleKeyDown}
|
|
212
211
|
ref={c => (c ? (this._menuElement = c) : undefined)}
|
|
213
212
|
className={[style.dropdownMenu, ...this.state.position].join(' ')}
|
|
@@ -222,7 +221,8 @@ class Menu extends Component<MenuProps & WithEventManagerProps, any> {
|
|
|
222
221
|
}}
|
|
223
222
|
key={index}
|
|
224
223
|
data={o}
|
|
225
|
-
role=
|
|
224
|
+
role="option"
|
|
225
|
+
aria-selected={this.isSelected(o)}
|
|
226
226
|
/>
|
|
227
227
|
))}
|
|
228
228
|
</div>
|
|
@@ -283,7 +283,7 @@ class MenuItem extends Component<any, any> {
|
|
|
283
283
|
<div
|
|
284
284
|
role={props?.role}
|
|
285
285
|
tabIndex={-1}
|
|
286
|
-
aria-
|
|
286
|
+
aria-selected={props.isSelected(props.data)}
|
|
287
287
|
ref={element => {
|
|
288
288
|
this.props.addAccessibleChild(element);
|
|
289
289
|
if (props.isSelected(props.data)) {
|