@playkit-js/playkit-js-ui 0.79.3 → 0.79.4
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
|
@@ -16,6 +16,7 @@ interface TooltipOwnProps {
|
|
|
16
16
|
type?: ToolTipPosition;
|
|
17
17
|
maxWidth?: string;
|
|
18
18
|
label: string;
|
|
19
|
+
strictPosition?: boolean;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
type TooltipProps = ReduxStateProps & TooltipOwnProps;
|
|
@@ -69,7 +70,8 @@ class Tooltip extends Component<TooltipProps & WithEventManagerProps, any> {
|
|
|
69
70
|
*/
|
|
70
71
|
static defaultProps = {
|
|
71
72
|
type: ToolTipType.Top,
|
|
72
|
-
maxWidth: '240px'
|
|
73
|
+
maxWidth: '240px',
|
|
74
|
+
strictPosition: false
|
|
73
75
|
};
|
|
74
76
|
|
|
75
77
|
/**
|
|
@@ -174,6 +176,9 @@ class Tooltip extends Component<TooltipProps & WithEventManagerProps, any> {
|
|
|
174
176
|
* @returns {string} is in boundaries
|
|
175
177
|
*/
|
|
176
178
|
isToolTipInBoundaries(): boolean {
|
|
179
|
+
if (this.props.strictPosition) {
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
177
182
|
const tooltipBoundingRect = this.textElement.getBoundingClientRect();
|
|
178
183
|
const playerContainerRect = this.props.playerClientRect;
|
|
179
184
|
|
|
@@ -275,8 +280,7 @@ class Tooltip extends Component<TooltipProps & WithEventManagerProps, any> {
|
|
|
275
280
|
className={style.tooltip}
|
|
276
281
|
onMouseOver={this.onMouseOver}
|
|
277
282
|
onMouseLeave={this.onMouseLeave}
|
|
278
|
-
ref={el => (el ? (this.tooltipElement = el) : undefined)}
|
|
279
|
-
>
|
|
283
|
+
ref={el => (el ? (this.tooltipElement = el) : undefined)}>
|
|
280
284
|
{children}
|
|
281
285
|
<span style={{maxWidth: props.maxWidth}} ref={el => (el ? (this.textElement = el) : undefined)} className={className.join(' ')}>
|
|
282
286
|
{props.label}
|