Skip to content

Commit f59d1b2

Browse files
PageHeader: Remove tooltip from default since title is present (#3099)
1 parent 1e609b4 commit f59d1b2

File tree

1 file changed

+1
-48
lines changed

1 file changed

+1
-48
lines changed

components/page-header/private/detail-block.jsx

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import React, { Component } from 'react';
77
import PropTypes from 'prop-types';
88
import classnames from 'classnames';
9-
import Tooltip from '../../tooltip';
109

1110
const displayName = 'PageHeaderDetailRow';
1211
const propTypes = {
@@ -43,21 +42,6 @@ const defaultProps = {
4342
};
4443

4544
class DetailBlock extends Component {
46-
constructor(props) {
47-
super(props);
48-
this.state = { showTooltip: false };
49-
}
50-
51-
componentDidMount() {
52-
this.renderFieldTruncation();
53-
}
54-
55-
componentDidUpdate(prevProps) {
56-
if (this.props.content !== prevProps.content) {
57-
this.renderFieldTruncation();
58-
}
59-
}
60-
6145
renderContent() {
6246
const { content, truncate } = this.props;
6347

@@ -80,35 +64,6 @@ class DetailBlock extends Component {
8064
return content;
8165
}
8266

83-
renderContentWithTooltip() {
84-
const { content, truncate } = this.props;
85-
const labelClasses = classnames({ 'slds-truncate': truncate });
86-
87-
return (
88-
<Tooltip
89-
align="top"
90-
content={content}
91-
triggerStyle={{ display: 'inline' }}
92-
>
93-
<div className={labelClasses} tabIndex="0" title={content}>
94-
{content}
95-
</div>
96-
</Tooltip>
97-
);
98-
}
99-
100-
renderFieldTruncation() {
101-
const fieldContent = this.fieldContentRef;
102-
const isTruncated =
103-
fieldContent && fieldContent.scrollWidth > fieldContent.offsetWidth;
104-
105-
if (isTruncated) {
106-
this.setState({ showTooltip: true });
107-
} else {
108-
this.setState({ showTooltip: false });
109-
}
110-
}
111-
11267
renderLabel() {
11368
const { label, truncate } = this.props;
11469

@@ -137,9 +92,7 @@ class DetailBlock extends Component {
13792
return (
13893
<li className={classes}>
13994
{this.renderLabel()}
140-
{this.state.showTooltip
141-
? this.renderContentWithTooltip()
142-
: this.renderContent()}
95+
{this.renderContent()}
14396
</li>
14497
);
14598
}

0 commit comments

Comments
 (0)