add/fix label tooltips (#1278)

* Move tooltip to right

* Change function to only return truncated string

* add tooltip to category label

* use position instead of PopoutPosition
This commit is contained in:
Severiano Badajoz
2020-03-23 10:28:54 -07:00
committed by GitHub
parent d99b84ba09
commit b249df9036
3 changed files with 65 additions and 45 deletions
+6 -12
View File
@@ -1,18 +1,12 @@
const maybeTruncateString = (str, maxLength) => {
let truncatedString = null;
if (
str.length > maxLength
) {
truncatedString = `${str.slice(
0,
maxLength / 2
)}…${str.slice(
if (str.length > maxLength) {
truncatedString = `${str.slice(0, maxLength / 2)}…${str.slice(
-maxLength / 2
)}`;
}
}
return truncatedString || str;
}
return truncatedString;
};
export default maybeTruncateString;
export default maybeTruncateString;