@playkit-js/hotspots 3.2.20 → 3.2.21
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
|
@@ -74,29 +74,19 @@ export default class Hotspot extends Component<Props, State> {
|
|
|
74
74
|
const {hotspot, dispatcher} = this.props;
|
|
75
75
|
|
|
76
76
|
if (!hotspot || !hotspot.onClick) {
|
|
77
|
-
this.setState({ isReady: true }
|
|
78
|
-
this.setFocus();
|
|
79
|
-
});
|
|
77
|
+
this.setState({ isReady: true });
|
|
80
78
|
return;
|
|
81
79
|
}
|
|
82
80
|
|
|
83
|
-
this.setState(
|
|
84
|
-
|
|
85
|
-
()
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
);
|
|
81
|
+
this.setState({
|
|
82
|
+
isReady: true,
|
|
83
|
+
disableClick: !this.isClickable()
|
|
84
|
+
});
|
|
89
85
|
|
|
90
86
|
const {id, label} = hotspot;
|
|
91
87
|
dispatcher(HotspotsEvents.HOTSPOT_DISPLAYED, {id, label});
|
|
92
88
|
}
|
|
93
89
|
|
|
94
|
-
setFocus = () => {
|
|
95
|
-
if (this.hotspotRef) {
|
|
96
|
-
setTimeout(() => this.hotspotRef?.focus(), 0);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
|
|
100
90
|
isClickable = (): boolean => {
|
|
101
91
|
const {
|
|
102
92
|
hotspot: {onClick}
|
|
@@ -203,7 +193,7 @@ export default class Hotspot extends Component<Props, State> {
|
|
|
203
193
|
};
|
|
204
194
|
|
|
205
195
|
return (
|
|
206
|
-
<A11yWrapper onClick={this.handleClick} aria-live="polite">
|
|
196
|
+
<A11yWrapper onClick={this.handleClick} role='alert' aria-live="polite">
|
|
207
197
|
<div ref={(ref) => (this.hotspotRef = ref)} tabIndex={0} role="button" aria-label={label} aria-disabled={disableClick} style={containerStyles} data-testid="hotspots_hotspot">
|
|
208
198
|
<div style={buttonStyles}>{label}</div>
|
|
209
199
|
</div>
|